Skip to content

Commit 08ce8c5

Browse files
committed
GH-1224 Fix off-by-one error
1 parent 740ec2e commit 08ce8c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/net_plugin/net_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ namespace eosio {
626626
};
627627

628628
bool peer_sync_state::valid() const {
629-
bool valid = start_block > 0 && end_block >= start_block && last >= start_block && last <= end_block;
629+
bool valid = start_block > 0 && end_block >= start_block && last >= start_block-1 && last <= end_block;
630630
if (sync_type == sync_t::block_nack && valid) {
631631
// block nack should only be used for "current" blocks, limit size to something reasonable
632632
const auto size = end_block - start_block;

0 commit comments

Comments
 (0)