Skip to content

Commit

Permalink
Merge remote-tracking branch 'spring/release/1.0' into GH-579-max-rev…
Browse files Browse the repository at this point in the history
…ersible-blocks-savanna-main
  • Loading branch information
heifner committed Aug 19, 2024
2 parents e53107c + 381726b commit 2e83a77
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,13 @@ struct controller_impl {
return prev->block_num();
}

// returns 0 for legacy
size_t fork_db_savanna_size() const {
return fork_db.apply_s<size_t>([&](const auto& forkdb) {
return forkdb.size();
});
}

bool fork_db_block_exists( const block_id_type& id ) const {
return fork_db.apply<bool>([&](const auto& forkdb) {
return forkdb.block_exists(id);
Expand Down Expand Up @@ -4792,9 +4799,9 @@ struct controller_impl {
("n", reversible_block_num)("num", conf.terminate_at_block) );
return true;
}
if (conf.max_reversible_blocks > 0 && fork_db.size() >= conf.max_reversible_blocks) {
if (conf.max_reversible_blocks > 0 && fork_db_savanna_size() >= conf.max_reversible_blocks) {
elog("Exceeded max reversible blocks allowed, fork db size ${s} >= max-reversible-blocks ${m}",
("s", fork_db.size())("m", conf.max_reversible_blocks));
("s", fork_db_savanna_size())("m", conf.max_reversible_blocks));
return true;
}
return false;
Expand Down

0 comments on commit 2e83a77

Please sign in to comment.