Skip to content

Commit 346e84e

Browse files
committed
GH-284 Use scoped_set_value for replaying
1 parent b565770 commit 346e84e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libraries/chain/controller.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,6 @@ struct controller_impl {
17011701
}
17021702

17031703
void replay(startup_t startup) {
1704-
replaying = true;
1705-
17061704
bool replay_block_log_needed = should_replay_block_log();
17071705

17081706
auto blog_head = blog.head();
@@ -1840,8 +1838,6 @@ struct controller_impl {
18401838
};
18411839
fork_db.apply<void>(replay_fork_db);
18421840

1843-
replaying = false;
1844-
18451841
if( except_ptr ) {
18461842
std::rethrow_exception( except_ptr );
18471843
}
@@ -1990,6 +1986,7 @@ struct controller_impl {
19901986
ilog( "chain database started with hash: ${hash}", ("hash", calculate_integrity_hash()) );
19911987
okay_to_print_integrity_hash_on_stop = true;
19921988

1989+
fc::scoped_set_value r(replaying, true);
19931990
replay( startup ); // replay any irreversible and reversible blocks ahead of current head
19941991

19951992
if( check_shutdown() ) return;
@@ -4354,6 +4351,7 @@ struct controller_impl {
43544351
}
43554352
}
43564353

4354+
auto start = fc::time_point::now();
43574355
for( auto ritr = new_head_branch.rbegin(); ritr != new_head_branch.rend(); ++ritr ) {
43584356
auto except = std::exception_ptr{};
43594357
const auto& bsp = *ritr;

0 commit comments

Comments
 (0)