Skip to content

Commit

Permalink
Flush block log when appending #588 #589
Browse files Browse the repository at this point in the history
  • Loading branch information
theoreticalbts committed Nov 23, 2016
1 parent 61167d2 commit 419efce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3499,10 +3499,14 @@ void database::update_last_irreversible_block()
if( tmp_head )
log_head_num = tmp_head->block_num();

while( log_head_num < dpo.last_irreversible_block_num )
if( log_head_num < dpo.last_irreversible_block_num )
{
_block_log.append( *fetch_block_by_number( log_head_num + 1 ) );
log_head_num++;
while( log_head_num < dpo.last_irreversible_block_num )
{
_block_log.append( *fetch_block_by_number( log_head_num + 1 ) );
log_head_num++;
}
_block_log.flush();
}
}
}
Expand Down

0 comments on commit 419efce

Please sign in to comment.