Skip to content

Commit

Permalink
GH-773 Simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Sep 18, 2024
1 parent bdde4d8 commit 8a2fcf3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,10 +2182,7 @@ namespace eosio {
// do not allow to get too far ahead (sync_fetch_span) of chain head
// use chain head instead of fork head so we do not get too far ahead of applied blocks
uint32_t head_num = my_impl->get_chain_head_num();
if (blk_num < head_num) { // avoid underflow on blk_num - head_num
return true;
}
block_num_type num_blocks_not_applied = blk_num - head_num;
block_num_type num_blocks_not_applied = blk_num > head_num ? blk_num - head_num : 0;
if (num_blocks_not_applied < sync_fetch_span) {
fc_dlog(logger, "sync ahead allowed past sync-fetch-span ${sp}, block ${bn} chain_lib ${cl}, forkdb size ${s}",
("bn", blk_num)("sp", sync_fetch_span)("cl", head_num)("s", my_impl->chain_plug->chain().fork_db_size()));
Expand Down

0 comments on commit 8a2fcf3

Please sign in to comment.