Skip to content

Commit

Permalink
GH-2102 On startup pending_head forkdb blocks are processed. If asked…
Browse files Browse the repository at this point in the history
… to terminate at a block don't put any blocks above that in the fork database.
  • Loading branch information
heifner committed Apr 4, 2024
1 parent 4c3535f commit 112bb69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3696,7 +3696,9 @@ struct controller_impl {
EOS_ASSERT( id == bsp->id(), block_validate_exception,
"provided id ${id} does not match block id ${bid}", ("id", id)("bid", bsp->id()) );

forkdb.add(bsp, mark_valid_t::no, ignore_duplicate_t::yes);
if (conf.terminate_at_block > 0 && bsp->block_num() <= conf.terminate_at_block) {
forkdb.add(bsp, mark_valid_t::no, ignore_duplicate_t::yes);
}

return block_handle{bsp};
}
Expand Down

0 comments on commit 112bb69

Please sign in to comment.