Skip to content

Commit

Permalink
GH-773 Guard against underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Sep 14, 2024
1 parent 8737c4e commit 9a72b28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@ namespace eosio {
if (cc.get_read_mode() == db_read_mode::IRREVERSIBLE) {
// chain head == lib == fork_db_root in irreversible
auto forkdb_head = cc.fork_db_head();
if (forkdb_head.block_num() - head_num >= sync_fetch_span) {
if (forkdb_head.block_num() > head_num && forkdb_head.block_num() - head_num >= sync_fetch_span) {
auto calculated_lib = forkdb_head.irreversible_blocknum();
if (calculated_lib <= head_num) {
fc_ilog(logger, "sync ahead allowed past sync-fetch-span ${sp} for paused LIB ${l}, chain_lib ${cl}, forkdb size ${s}",
Expand Down

0 comments on commit 9a72b28

Please sign in to comment.