diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index 0c54dbf0f9..7dab0b27d6 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -613,7 +613,8 @@ 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 @@ -621,7 +622,7 @@ void database::_apply_block( const signed_block& next_block ) * 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; } @@ -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(); diff --git a/tests/tests/network_broadcast_api_tests.cpp b/tests/tests/network_broadcast_api_tests.cpp index 9a4a264492..17dd7e8857 100644 --- a/tests/tests/network_broadcast_api_tests.cpp +++ b/tests/tests/network_broadcast_api_tests.cpp @@ -43,6 +43,9 @@ BOOST_AUTO_TEST_CASE( broadcast_transaction_with_callback_test ) { auto callback = [&]( const variant& v ) { ++called; + idump((v)); + auto callback_obj = v.as(200); + BOOST_CHECK_EQUAL( callback_obj.trx.operations.size(), callback_obj.trx.operation_results.size() ); }; fc::ecc::private_key cid_key = fc::ecc::private_key::regenerate( fc::digest("key") );