diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index 571dc62845..c5e108f2e7 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -386,7 +386,6 @@ void database::process_budget() - rec.from_accumulated_fees - rec.from_unused_witness_budget; - share_type unused_prev_witness_budget = dpo.witness_budget; modify(core, [&]( asset_dynamic_data_object& _core ) { _core.current_supply = (_core.current_supply + rec.supply_delta ); @@ -396,10 +395,11 @@ void database::process_budget() + worker_budget - leftover_worker_funds - _core.accumulated_fees - - unused_prev_witness_budget + - dpo.witness_budget ); _core.accumulated_fees = 0; }); + modify(dpo, [&]( dynamic_global_property_object& _dpo ) { // Since initial witness_budget was rolled into diff --git a/libraries/chain/db_update.cpp b/libraries/chain/db_update.cpp index c1c1eb5d20..c67a6b6bc0 100644 --- a/libraries/chain/db_update.cpp +++ b/libraries/chain/db_update.cpp @@ -80,14 +80,15 @@ void database::update_global_dynamic_data( const signed_block& b ) if( !(get_node_properties().skip_flags & skip_undo_history_check) ) { - GRAPHENE_ASSERT( _dgp.recently_missed_count < GRAPHENE_MAX_UNDO_HISTORY, undo_database_exception, + GRAPHENE_ASSERT( _dgp.head_block_number - _dgp.last_irreversible_block_num < GRAPHENE_MAX_UNDO_HISTORY, undo_database_exception, "The database does not have enough undo history to support a blockchain with so many missed blocks. " "Please add a checkpoint if you would like to continue applying blocks beyond this point.", + ("last_irreversible_block_num",_dgp.last_irreversible_block_num)("head", _dgp.head_block_number) ("recently_missed",_dgp.recently_missed_count)("max_undo",GRAPHENE_MAX_UNDO_HISTORY) ); } - _undo_db.set_max_size( _dgp.recently_missed_count + GRAPHENE_MIN_UNDO_HISTORY ); - _fork_db.set_max_size( _dgp.recently_missed_count + GRAPHENE_MIN_UNDO_HISTORY ); + _undo_db.set_max_size( _dgp.head_block_number - _dgp.last_irreversible_block_num + GRAPHENE_MIN_UNDO_HISTORY ); + _fork_db.set_max_size( _dgp.head_block_number - _dgp.last_irreversible_block_num + GRAPHENE_MIN_UNDO_HISTORY ); } void database::update_signing_witness(const witness_object& signing_witness, const signed_block& new_block)