From 59031ab71d36c1010285aa01345b826112ff9d09 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Tue, 17 Oct 2023 13:55:26 -0500 Subject: [PATCH] GH-1776 Fix for throttling the last block of a peer_requested dropping the last block and not sending it later --- plugins/net_plugin/net_plugin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 5a401f7cb9..9b3ed88405 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -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; @@ -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