Skip to content

Commit

Permalink
Merge pull request #1793 from AntelopeIO/GH-1776-throttle-fix-main
Browse files Browse the repository at this point in the history
[5.0 -> main] P2P: Fix: Throttling of last block of request caused lost block
  • Loading branch information
heifner authored Oct 18, 2023
2 parents 24cf623 + 7be4d65 commit 13e1fe4
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 13e1fe4

Please sign in to comment.