Skip to content

Commit

Permalink
GH-1228 Log snapshot loaded for both cases
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jun 15, 2023
1 parent 3f19608 commit 1dca359
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,12 @@ struct controller_impl {
} else {
ilog( "Starting initialization from snapshot and no block log, this may take a significant amount of time" );
read_from_snapshot( snapshot, 0, std::numeric_limits<uint32_t>::max() );
const uint32_t lib_num = head->block_num;
ilog( "Snapshot loaded, lib: ${lib}", ("lib", lib_num) );
EOS_ASSERT( lib_num > 0, snapshot_exception,
EOS_ASSERT( head->block_num > 0, snapshot_exception,
"Snapshot indicates controller head at block number 0, but that is not allowed. "
"Snapshot is invalid." );
blog.reset( chain_id, lib_num + 1 );
blog.reset( chain_id, head->block_num + 1 );
}
ilog( "Snapshot loaded, lib: ${lib}", ("lib", head->block_num) );

init(check_shutdown);
ilog( "Finished initialization from snapshot" );
Expand Down

0 comments on commit 1dca359

Please sign in to comment.