Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

net_plugin bugfix backport of PR10349 #10352

Merged
merged 1 commit into from
May 11, 2021
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
10 changes: 9 additions & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,15 @@ namespace eosio {
peer_requested.reset();
flush_queues();
} else {
peer_requested = peer_sync_state( msg.start_block, msg.end_block, msg.start_block-1);
if (peer_requested) {
// This happens when peer already requested some range and sync is still in progress
// It could be higher in case of peer requested head catchup and current request is lib catchup
// So to make sure peer will receive all requested blocks we assign end_block to highest value
peer_requested->end_block = std::max(msg.end_block, peer_requested->end_block);
}
else {
peer_requested = peer_sync_state( msg.start_block, msg.end_block, msg.start_block-1);
}
enqueue_sync_block();
}
}
Expand Down