Skip to content

Commit

Permalink
Consolidate received_frontier transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiySW authored and clemahieu committed Aug 6, 2018
1 parent e56e5a9 commit ada4338
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions rai/node/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,19 @@ void rai::frontier_req_client::received_frontier (boost::system::error_code cons
{
BOOST_LOG (connection->node->log) << boost::str (boost::format ("Received %1% frontiers from %2%") % std::to_string (count) % connection->socket->remote_endpoint ());
}
rai::transaction transaction (connection->node->store.environment, nullptr, false);
if (!account.is_zero ())
{
while (!current.is_zero () && current < account)
{
// We know about an account they don't.
rai::transaction transaction (connection->node->store.environment, nullptr, false);
unsynced (info.head, 0);
next (transaction);
}
if (!current.is_zero ())
{
if (account == current)
{
rai::transaction transaction (connection->node->store.environment, nullptr, false);
if (latest == info.head)
{
// In sync
Expand Down Expand Up @@ -322,14 +321,11 @@ void rai::frontier_req_client::received_frontier (boost::system::error_code cons
}
else
{
while (!current.is_zero ())
{
rai::transaction transaction (connection->node->store.environment, nullptr, false);
while (!current.is_zero ())
{
// We know about an account they don't.
unsynced (info.head, 0);
next (transaction);
}
// We know about an account they don't.
unsynced (info.head, 0);
next (transaction);
}
if (connection->node->config.logging.bulk_pull_logging ())
{
Expand Down

0 comments on commit ada4338

Please sign in to comment.