Skip to content

Commit

Permalink
GH-670 Sync from diff peer when syncing ahead. Also no need request_n…
Browse files Browse the repository at this point in the history
…ext_chunk() if sync_last_requested_num > 0 as a request was likely just made.
  • Loading branch information
heifner committed Aug 29, 2024
1 parent c0c1aa4 commit c5f0418
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2211,14 +2211,13 @@ namespace eosio {
set_state( lib_catchup );
sync_last_requested_num = 0;
sync_next_expected_num = chain_info.lib_num + 1;
} else if (is_sync_request_ahead_allowed(sync_next_expected_num)) {
// break
request_next_chunk( c );
} else if (sync_last_requested_num > 0 && is_sync_request_ahead_allowed(sync_next_expected_num)) {
request_next_chunk();
} else {
peer_dlog(c, "already syncing, start sync ignored");
return;
}

request_next_chunk( c );
}

// thread safe
Expand Down

0 comments on commit c5f0418

Please sign in to comment.