Skip to content

Commit

Permalink
Merge pull request #1791 from AntelopeIO/GH-1776-throttle-fix-5.0
Browse files Browse the repository at this point in the history
[5.0] P2P: Fix: Throttling of last block of request caused lost block
  • Loading branch information
heifner authored Oct 18, 2023
2 parents ec79fa2 + 59031ab commit f65b06c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1732,10 +1732,6 @@ namespace eosio {
peer_dlog( this, "enqueue sync block ${num}", ("num", peer_requested->last + 1) );
}
uint32_t num = peer_requested->last + 1;
if(num == peer_requested->end_block) {
peer_requested.reset();
peer_dlog( this, "completing enqueue_sync_block ${num}", ("num", num) );
}

controller& cc = my_impl->chain_plug->chain();
signed_block_ptr sb;
Expand All @@ -1756,6 +1752,10 @@ namespace eosio {
block_sync_throttling = false;
block_sync_bytes_sent += enqueue_block( sb, true );
++peer_requested->last;
if(num == peer_requested->end_block) {
peer_requested.reset();
peer_dlog( this, "completing enqueue_sync_block ${num}", ("num", num) );
}
} else {
peer_ilog( this, "enqueue sync, unable to fetch block ${num}, sending benign_other go away", ("num", num) );
peer_requested.reset(); // unable to provide requested blocks
Expand Down

0 comments on commit f65b06c

Please sign in to comment.