From 47dcfb048a7521708b250e897eac943a9ea58634 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 15 Sep 2023 09:43:45 -0500 Subject: [PATCH] Remove optimization and force write, which allows for a manual ship log repair. --- libraries/state_history/include/eosio/state_history/log.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/state_history/include/eosio/state_history/log.hpp b/libraries/state_history/include/eosio/state_history/log.hpp index a3a0da67f7..828284e217 100644 --- a/libraries/state_history/include/eosio/state_history/log.hpp +++ b/libraries/state_history/include/eosio/state_history/log.hpp @@ -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 )