A queue of Transactions, each stored as RLP.
More...
#include <TransactionQueue.h>
A queue of Transactions, each stored as RLP.
Maintains a transaction queue sorted by nonce diff and gas price.
Definition at line 48 of file TransactionQueue.h.
TransactionQueue::TransactionQueue |
( |
unsigned |
_limit = 1024 , |
|
|
unsigned |
_futureLimit = 1024 |
|
) |
| |
TransactionQueue.
- Parameters
-
_limit | Maximum number of pending transactions in the queue. |
_futureLimit | Maximum number of future nonce transactions. |
Definition at line 36 of file TransactionQueue.cpp.
dev::eth::TransactionQueue::TransactionQueue |
( |
Limits const & |
_l | ) |
|
|
inline |
TransactionQueue::~TransactionQueue |
( |
| ) |
|
void TransactionQueue::clear |
( |
| ) |
|
void TransactionQueue::drop |
( |
h256 const & |
_txHash | ) |
|
void TransactionQueue::dropGood |
( |
Transaction const & |
_t | ) |
|
Drop a trasnaction from the list if exists and move following future trasnactions to current (if any)
- Parameters
-
Definition at line 354 of file TransactionQueue.cpp.
void TransactionQueue::enqueue |
( |
RLP const & |
_data, |
|
|
h512 const & |
_nodeId |
|
) |
| |
Add transaction to the queue to be verified and imported.
- Parameters
-
_data | RLP encoded transaction data. |
_nodeId | Optional network identified of a node transaction comes from. |
Definition at line 374 of file TransactionQueue.cpp.
Verify and add transaction to the queue synchronously.
- Parameters
-
_tx | RLP encoded transaction data. |
_ik | Set to Retry to force re-addinga transaction that was previously dropped. |
- Returns
- Import result code.
Definition at line 68 of file TransactionQueue.h.
Verify and add transaction to the queue synchronously.
- Parameters
-
_tx | Trasnaction data. |
_ik | Set to Retry to force re-addinga transaction that was previously dropped. |
- Returns
- Import result code.
Definition at line 101 of file TransactionQueue.cpp.
void TransactionQueue::insertCurrent_WITH_LOCK |
( |
std::pair< h256, Transaction > const & |
_p | ) |
|
|
private |
h256Hash TransactionQueue::knownTransactions |
( |
| ) |
const |
Get a hash set of transactions in the queue.
- Returns
- A hash set of all transactions in the queue
Definition at line 132 of file TransactionQueue.cpp.
Limits dev::eth::TransactionQueue::limits |
( |
| ) |
const |
|
inline |
void TransactionQueue::makeCurrent_WITH_LOCK |
( |
Transaction const & |
_t | ) |
|
|
private |
u256 TransactionQueue::maxNonce |
( |
Address const & |
_a | ) |
const |
Get max nonce for an account.
- Returns
- Max transaction nonce for account in the queue
Definition at line 204 of file TransactionQueue.cpp.
u256 TransactionQueue::maxNonce_WITH_LOCK |
( |
Address const & |
_a | ) |
const |
|
private |
Register a handler that will be called once asynchronous verification is comeplte an transaction has been imported.
Definition at line 126 of file TransactionQueue.h.
template<class T >
Handler dev::eth::TransactionQueue::onReady |
( |
T const & |
_t | ) |
|
|
inline |
Register a handler that will be called once there is a new transaction imported.
Definition at line 123 of file TransactionQueue.h.
template<class T >
Handler<h256 const&> dev::eth::TransactionQueue::onReplaced |
( |
T const & |
_t | ) |
|
|
inline |
Register a handler that will be called once asynchronous verification is comeplte an transaction has been imported.
Definition at line 129 of file TransactionQueue.h.
bool TransactionQueue::remove_WITH_LOCK |
( |
h256 const & |
_txHash | ) |
|
|
private |
void TransactionQueue::setFuture |
( |
h256 const & |
_t | ) |
|
Mark transaction as future.
It wont be retured in topTransactions list until a transaction with a preceeding nonce is imported or marked with dropGood
- Parameters
-
Definition at line 273 of file TransactionQueue.cpp.
Status dev::eth::TransactionQueue::status |
( |
| ) |
const |
|
inline |
Get top transactions from the queue.
Returned transactions are not removed from the queue automatically.
- Parameters
-
_limit | Max number of transactions to return. |
_avoid | Transactions to avoid returning. |
- Returns
- up to _limit transactions ordered by nonce and gas price.
Definition at line 122 of file TransactionQueue.cpp.
void TransactionQueue::verifierBody |
( |
| ) |
|
|
private |
unsigned TransactionQueue::waiting |
( |
Address const & |
_a | ) |
const |
Get number of pending transactions for account.
- Returns
- Pending transaction count.
Definition at line 260 of file TransactionQueue.cpp.
std::atomic<bool> dev::eth::TransactionQueue::m_aborting = {false} |
|
private |
std::unordered_map<Address, std::map<u256, PriorityQueue::iterator> > dev::eth::TransactionQueue::m_currentByAddressAndNonce |
|
private |
std::unordered_map<h256, PriorityQueue::iterator> dev::eth::TransactionQueue::m_currentByHash |
|
private |
h256Hash dev::eth::TransactionQueue::m_dropped |
|
private |
unsigned dev::eth::TransactionQueue::m_futureLimit |
|
private |
unsigned dev::eth::TransactionQueue::m_futureSize = 0 |
|
private |
h256Hash dev::eth::TransactionQueue::m_known |
|
private |
unsigned dev::eth::TransactionQueue::m_limit |
|
private |
Called for each import attempt. Arguments are result, transaction id an node id. Be nice and exit fast.
Definition at line 204 of file TransactionQueue.h.
Signal dev::eth::TransactionQueue::m_onReady |
|
private |
Future transactions.
Called when a subsequent call to import transactions will return a non-empty container. Be nice and exit fast.
Definition at line 203 of file TransactionQueue.h.
Signal<h256 const&> dev::eth::TransactionQueue::m_onReplaced |
|
private |
Called whan transction is dropped during a call to import() to make room for another transaction.
Definition at line 205 of file TransactionQueue.h.
std::condition_variable dev::eth::TransactionQueue::m_queueReady |
|
private |
std::vector<std::thread> dev::eth::TransactionQueue::m_verifiers |
|
private |
Mutex dev::eth::TransactionQueue::x_queue |
|
mutableprivate |
The documentation for this class was generated from the following files: