diff --git a/libraries/chain/include/eosio/chain/unapplied_transaction_queue.hpp b/libraries/chain/include/eosio/chain/unapplied_transaction_queue.hpp index da90ba3abd2..2ebe4f8a889 100644 --- a/libraries/chain/include/eosio/chain/unapplied_transaction_queue.hpp +++ b/libraries/chain/include/eosio/chain/unapplied_transaction_queue.hpp @@ -129,7 +129,6 @@ class unapplied_transaction_queue { ("id", itr->id())("e", itr->trx_meta->packed_trx()->expiration()) ("bt", pending_block_time) ) ) ) ); } - removed( itr ); persisted_by_expiry.erase( itr ); } @@ -146,6 +145,10 @@ class unapplied_transaction_queue { if( itr != queue.get().end() ) { if( itr->trx_type != trx_enum_type::persisted && itr->trx_type != trx_enum_type::incoming_persisted ) { + if( itr->next ) { + itr->next( std::static_pointer_cast( std::make_shared( + FC_LOG_MESSAGE( info, "duplicate transaction ${id}", ("id", itr->trx_meta->id()))))); + } removed( itr ); idx.erase( itr ); } @@ -221,6 +224,7 @@ class unapplied_transaction_queue { iterator incoming_begin() { return queue.get().lower_bound( trx_enum_type::incoming_persisted ); } iterator incoming_end() { return queue.get().end(); } // if changed to upper_bound, verify usage performance + /// caller's responsibilty to call next() if applicable iterator erase( iterator itr ) { removed( itr ); return queue.get().erase( itr ); diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index 9cb1f04520b..f4a858e4e64 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -1595,12 +1595,14 @@ bool producer_plugin_impl::process_unapplied_trxs( const fc::time_point& deadlin } else { // this failed our configured maximum transaction time, we don't want to replay it ++num_failed; + if( itr->next ) itr->next( trace ); itr = _unapplied_transactions.erase( itr ); continue; } } else { ++num_applied; if( itr->trx_type != trx_enum_type::persisted ) { + if( itr->next ) itr->next( trace ); itr = _unapplied_transactions.erase( itr ); continue; }