Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] P2P: Fix: Throttling of last block of request caused lost block #1791

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading