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

transactions in progress #8158

Merged
merged 2 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1596,12 +1596,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