Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8158 from EOSIO/net-plugin-trx-calc
Browse files Browse the repository at this point in the history
transactions in progress
  • Loading branch information
heifner authored Nov 5, 2019
2 parents 6569702 + 96f3289 commit 806c7ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -146,6 +145,10 @@ class unapplied_transaction_queue {
if( itr != queue.get<by_trx_id>().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<fc::exception>( std::make_shared<tx_duplicate>(
FC_LOG_MESSAGE( info, "duplicate transaction ${id}", ("id", itr->trx_meta->id())))));
}
removed( itr );
idx.erase( itr );
}
Expand Down Expand Up @@ -221,6 +224,7 @@ class unapplied_transaction_queue {
iterator incoming_begin() { return queue.get<by_type>().lower_bound( trx_enum_type::incoming_persisted ); }
iterator incoming_end() { return queue.get<by_type>().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<by_type>().erase( itr );
Expand Down
2 changes: 2 additions & 0 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 806c7ee

Please sign in to comment.