A class to store and track transactions by peers.
More...
#include <txpool.h>
A class to store and track transactions by peers.
Definition at line 24 of file txpool.h.
◆ PoolTxMap
◆ TxPool()
| TxPool::TxPool |
( |
const std::string & |
txKindIn, |
|
|
std::chrono::seconds |
expireTimeIn, |
|
|
std::chrono::seconds |
expireIntervalIn |
|
) |
| |
|
inline |
◆ AddChildrenToWorkSet()
| void TxPool::AddChildrenToWorkSet |
( |
const CTransaction & |
tx | ) |
|
Add any tx that list a particular tx as a parent into the from peer's work set.
Definition at line 139 of file txpool.cpp.
◆ AddTx()
Add a new transaction to the pool.
Definition at line 15 of file txpool.cpp.
◆ EraseForBlock()
| void TxPool::EraseForBlock |
( |
const CBlock & |
block | ) |
|
Erase all txs included in or invalidated by a new block.
Definition at line 216 of file txpool.cpp.
◆ EraseForPeer()
| void TxPool::EraseForPeer |
( |
NodeId |
peer | ) |
|
Erase all txs announced by a peer (eg, after that peer disconnects)
Definition at line 86 of file txpool.cpp.
◆ EraseTx()
| int TxPool::EraseTx |
( |
const TxId & |
txid | ) |
|
Erase a tx by txid.
Definition at line 48 of file txpool.cpp.
◆ GetChildrenFromDifferentPeer()
Get all children that spend from this tx but were not received from nodeid.
Also return which peer provided each tx.
Definition at line 299 of file txpool.cpp.
◆ GetChildrenFromSamePeer()
Get all children that spend from this tx and were received from nodeid.
Sorted from most recent to least recent.
Definition at line 256 of file txpool.cpp.
◆ GetConflictTxs()
◆ GetTx()
◆ GetTxToReconsider()
Extract a transaction from a peer's work set.
Returns nullptr if there are no transactions to work on. Otherwise returns the transaction reference, and removes it from the work set.
Definition at line 190 of file txpool.cpp.
◆ HaveTx()
| bool TxPool::HaveTx |
( |
const TxId & |
txid | ) |
const |
Check if we already have an the transaction.
Definition at line 160 of file txpool.cpp.
◆ HaveTxToReconsider()
| bool TxPool::HaveTxToReconsider |
( |
NodeId |
peer | ) |
|
Does this peer have any work to do?
Definition at line 207 of file txpool.cpp.
◆ LimitTxs()
Limit the txs to the given maximum.
Definition at line 105 of file txpool.cpp.
◆ Size()
| size_t TxPool::Size |
( |
| ) |
const |
|
inline |
Return how many entries exist in the pool.
Definition at line 89 of file txpool.h.
◆ expireInterval
| const std::chrono::seconds TxPool::expireInterval |
|
protected |
Minimum time between transactions expire time checks.
Definition at line 97 of file txpool.h.
◆ expireTime
| const std::chrono::seconds TxPool::expireTime |
|
protected |
Expiration time for transactions.
Definition at line 95 of file txpool.h.
◆ m_next_sweep
Timestamp for the next scheduled sweep of expired transactions.
Definition at line 134 of file txpool.h.
◆ m_outpoint_to_tx_it
Index from the parents' COutPoint into the m_pool_txs.
Used to remove transactions from the m_pool_txs
Definition at line 128 of file txpool.h.
◆ m_peer_work_set
| std::map<NodeId, std::set<TxId> > TxPool::m_peer_work_set |
|
protected |
Which peer provided the transactions that need to be reconsidered.
Definition at line 113 of file txpool.h.
◆ m_pool_txs
Map from txid to pool transaction record.
Should be size constrained by calling LimitTxs() with the desired max size.
Definition at line 110 of file txpool.h.
◆ m_txs_list
| std::vector<PoolTxMap::iterator> TxPool::m_txs_list |
|
protected |
Pool transactions in vector for quick random eviction.
Definition at line 131 of file txpool.h.
◆ txKind
| const std::string TxPool::txKind |
|
protected |
The transaction kind as string, used for logging.
Definition at line 93 of file txpool.h.
The documentation for this class was generated from the following files: