diff --git a/docs b/docs index cdc8ea81..f42a917c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit cdc8ea8133a999afef8051700a4ce8edb0988ec4 +Subproject commit f42a917c0cb93784567d649be60d610469c33ee0 diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index a91ba696..b84a7995 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -357,26 +357,14 @@ const vector& database::get_applied_operations() const void database::apply_block( const signed_block& next_block, uint32_t skip ) { auto block_num = next_block.block_num(); - if( _checkpoints.size() ) + if( _checkpoints.size() && _checkpoints.rbegin()->second != block_id_type() ) { auto itr = _checkpoints.find( block_num ); if( itr != _checkpoints.end() ) FC_ASSERT( next_block.id() == itr->second, "Block did not match checkpoint", ("checkpoint",*itr)("block_id",next_block.id()) ); - auto last = _checkpoints.rbegin(); - if( last->first >= block_num ) - { - // WE CAN SKIP ALMOST EVERYTHING - skip = ~0; - - /** clear the recently missed count because the checkpoint indicates that - * we will never have to go back further than this. - */ - const auto& _dgp = dynamic_global_property_id_type(0)(*this); - modify( _dgp, [&]( dynamic_global_property_object& dgp ){ - dgp.recently_missed_count = 0; - }); - } + if( _checkpoints.rbegin()->first >= block_num ) + skip = ~0;// WE CAN SKIP ALMOST EVERYTHING } with_skip_flags( skip, [&]() diff --git a/libraries/chain/db_update.cpp b/libraries/chain/db_update.cpp index 4370d81b..d8328b13 100644 --- a/libraries/chain/db_update.cpp +++ b/libraries/chain/db_update.cpp @@ -49,8 +49,12 @@ void database::update_global_dynamic_data( const signed_block& b ) fc::raw::pack( enc, b.previous_secret ); dgp.random = enc.result(); - if( missed_blocks ) - dgp.recently_missed_count += 2*missed_blocks; + if( _checkpoints.size() && _checkpoints.rbegin()->first >= b.block_num() ) + dgp.recently_missed_count = 0; + else if( missed_blocks ) + dgp.recently_missed_count += 4*missed_blocks; + else if( dgp.recently_missed_count > 4 ) + dgp.recently_missed_count -= 3; else if( dgp.recently_missed_count > 0 ) dgp.recently_missed_count--;