Skip to content

Commit

Permalink
Remove optimization and force write, which allows for a manual ship l…
Browse files Browse the repository at this point in the history
…og repair.
  • Loading branch information
heifner committed Sep 15, 2023
1 parent 4973f63 commit 47dcfb0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libraries/state_history/include/eosio/state_history/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,7 @@ class state_history_log {
EOS_ASSERT( block_num > 2, chain::plugin_exception, "Existing ship log with ${eb} blocks when starting from genesis block ${b}",
("eb", _end_block)("b", block_num) );
// block_num < _begin_block = pruned log, need to call truncate() to reset
// get_block_id_i check is an optimization to avoid writing a block that is already in the log (snapshot or replay)
if ( block_num < _begin_block || get_block_id_i(block_num) != header.block_id ) {
if ( block_num < _begin_block ) {
truncate(block_num); //truncate is expected to always leave file pointer at the end
} else {
if (start_block_num == block_num || block_num % 1000 == 0 )
Expand Down

0 comments on commit 47dcfb0

Please sign in to comment.