Skip to content

Commit

Permalink
GH-2057 Don't bother including legacy in snapshot if pass transition
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Mar 19, 2024
1 parent 50fdb40 commit 52eb338
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1925,11 +1925,15 @@ struct controller_impl {
return apply<block_state_pair>(chain_head, overloaded{
[&](const block_state_legacy_ptr& head) {
if (fork_db.version_in_use() == fork_database::in_use_t::both) {
block_state_ptr bsp;
block_state_legacy_ptr legacy_head = head;
block_state_ptr savanna_head;
fork_db.apply_s<void>([&](const auto& forkdb) {
bsp = forkdb.head();
savanna_head = forkdb.head();
if (forkdb.root()->header.is_proper_svnn_block()) {
legacy_head.reset(); // not needed if past transition
}
});
return block_state_pair{ head, bsp };
return block_state_pair{ legacy_head, savanna_head };
}
return block_state_pair{ head, {} };
},
Expand Down

0 comments on commit 52eb338

Please sign in to comment.