Skip to content

Commit

Permalink
bugfix:fix snapshot integrity test
Browse files Browse the repository at this point in the history
  • Loading branch information
qianxiaofeng committed May 3, 2019
1 parent e7c66db commit ad8ee81
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,6 @@ struct controller_impl {

void init(std::function<bool()> shutdown, const snapshot_reader_ptr& snapshot) {

//do upgrade migration if necessary;
migrate_upgrade();

bool report_integrity_hash = !!snapshot;
if (snapshot) {
Expand All @@ -363,6 +361,9 @@ struct controller_impl {

read_from_snapshot( snapshot );

//do upgrade migration if necessary;
migrate_upgrade(); //compatiable for snapshot integrity test

auto end = blog.read_head();
if( !end ) {
blog.reset( conf.genesis, signed_block_ptr(), head->block_num + 1 );
Expand All @@ -373,6 +374,8 @@ struct controller_impl {
"Block log is provided with snapshot but does not contain the head block from the snapshot" );
}
} else {
//do upgrade migration if necessary;
migrate_upgrade(); //compatiable for snapshot integrity test
if( !head ) {
initialize_fork_db(); // set head to genesis state
}
Expand Down

0 comments on commit ad8ee81

Please sign in to comment.