Skip to content

Commit

Permalink
GH-1406 code_cache not likely to be useful for replay, remove all sta…
Browse files Browse the repository at this point in the history
…te files for replay
  • Loading branch information
heifner committed Oct 16, 2023
1 parent 3345300 commit 6cb1237
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,6 @@ void clear_directory_contents( const fc::path& p ) {
}
}

void clear_chainbase_files( const fc::path& p ) {
if( !fc::is_directory( p ) )
return;

fc::remove( p / "shared_memory.bin" );
fc::remove( p / "shared_memory.meta" );
}

namespace {
// This can be removed when versions of eosio that support reversible chainbase state file no longer supported.
void upgrade_from_reversible_to_fork_db(chain_plugin_impl* my) {
Expand Down Expand Up @@ -732,7 +724,7 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
ilog( "Replay requested: deleting state database" );
if( options.at( "truncate-at-block" ).as<uint32_t>() > 0 )
wlog( "The --truncate-at-block option does not work for a regular replay of the blockchain." );
clear_chainbase_files( my->chain_config->state_dir );
clear_directory_contents( my->chain_config->state_dir );
} else if( options.at( "truncate-at-block" ).as<uint32_t>() > 0 ) {
wlog( "The --truncate-at-block option can only be used with --hard-replay-blockchain." );
}
Expand Down

0 comments on commit 6cb1237

Please sign in to comment.