Skip to content

Commit

Permalink
Notify on_block listeners with processed block...
Browse files Browse the repository at this point in the history
... so that the listeners know the operation results
  • Loading branch information
abitmore committed Nov 5, 2021
1 parent ce9e480 commit f812666
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libraries/chain/db_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,16 @@ void database::_apply_block( const signed_block& next_block )

_issue_453_affected_assets.clear();

for( const auto& trx : next_block.transactions )
signed_block processed_block( next_block ); // make a copy
for( auto& trx : processed_block.transactions )
{
/* We do not need to push the undo state for each transaction
* because they either all apply and are valid or the
* entire block fails to apply. We only need an "undo" state
* for transactions when validating broadcast transactions or
* when building a block.
*/
apply_transaction( trx, skip );
trx.operation_results = apply_transaction( trx, skip ).operation_results;
++_current_trx_in_block;
}

Expand Down Expand Up @@ -661,7 +662,7 @@ void database::_apply_block( const signed_block& next_block )
apply_debug_updates();

// notify observers that the block has been applied
notify_applied_block( next_block ); //emit
notify_applied_block( processed_block ); //emit
_applied_ops.clear();

notify_changed_objects();
Expand Down

0 comments on commit f812666

Please sign in to comment.