Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 574 Lines • ▼ Show 20 Lines | private: | ||||
txlinksMap mapLinks; | txlinksMap mapLinks; | ||||
void UpdateParent(txiter entry, txiter parent, bool add); | void UpdateParent(txiter entry, txiter parent, bool add); | ||||
void UpdateChild(txiter entry, txiter child, bool add); | void UpdateChild(txiter entry, txiter child, bool add); | ||||
std::vector<indexed_transaction_set::const_iterator> | std::vector<indexed_transaction_set::const_iterator> | ||||
GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs); | GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
/** | |||||
* Track locally submitted transactions to periodically retry initial | |||||
* broadcast | |||||
*/ | |||||
std::set<TxId> m_unbroadcast_txids GUARDED_BY(cs); | |||||
public: | public: | ||||
indirectmap<COutPoint, const CTransaction *> mapNextTx GUARDED_BY(cs); | indirectmap<COutPoint, const CTransaction *> mapNextTx GUARDED_BY(cs); | ||||
std::map<TxId, Amount> mapDeltas; | std::map<TxId, Amount> mapDeltas; | ||||
/** | /** | ||||
* Create a new CTxMemPool. | * Create a new CTxMemPool. | ||||
*/ | */ | ||||
CTxMemPool(); | CTxMemPool(); | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | public: | ||||
CTransactionRef get(const TxId &txid) const; | CTransactionRef get(const TxId &txid) const; | ||||
TxMempoolInfo info(const TxId &txid) const; | TxMempoolInfo info(const TxId &txid) const; | ||||
std::vector<TxMempoolInfo> infoAll() const; | std::vector<TxMempoolInfo> infoAll() const; | ||||
CFeeRate estimateFee() const; | CFeeRate estimateFee() const; | ||||
size_t DynamicMemoryUsage() const; | size_t DynamicMemoryUsage() const; | ||||
/** Adds a transaction to the unbroadcast set */ | |||||
void AddUnbroadcastTx(const TxId &txid) { | |||||
LOCK(cs); | |||||
m_unbroadcast_txids.insert(txid); | |||||
} | |||||
/** Removes a transaction from the unbroadcast set */ | |||||
void RemoveUnbroadcastTx(const TxId &txid, const bool unchecked = false); | |||||
/** Returns transactions in unbroadcast set */ | |||||
const std::set<TxId> GetUnbroadcastTxs() const { | |||||
LOCK(cs); | |||||
return m_unbroadcast_txids; | |||||
} | |||||
private: | private: | ||||
/** | /** | ||||
* UpdateForDescendants is used by UpdateTransactionsFromBlock to update the | * UpdateForDescendants is used by UpdateTransactionsFromBlock to update the | ||||
* descendants for a single transaction that has been added to the mempool | * descendants for a single transaction that has been added to the mempool | ||||
* but may have child transactions in the mempool, eg during a chain reorg. | * but may have child transactions in the mempool, eg during a chain reorg. | ||||
* setExclude is the set of descendant transactions in the mempool that must | * setExclude is the set of descendant transactions in the mempool that must | ||||
* not be accounted for (because any descendants in setExclude were added to | * not be accounted for (because any descendants in setExclude were added to | ||||
* the mempool after the transaction being updated and hence their state is | * the mempool after the transaction being updated and hence their state is | ||||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |