Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 780 Lines • ▼ Show 20 Lines | public: | ||||
CFeeRate estimateFee() const; | CFeeRate estimateFee() const; | ||||
size_t DynamicMemoryUsage() const; | size_t DynamicMemoryUsage() const; | ||||
/** Adds a transaction to the unbroadcast set */ | /** Adds a transaction to the unbroadcast set */ | ||||
void AddUnbroadcastTx(const TxId &txid) { | void AddUnbroadcastTx(const TxId &txid) { | ||||
LOCK(cs); | LOCK(cs); | ||||
/** Sanity Check: the transaction should also be in the mempool */ | // Sanity Check: the transaction should also be in the mempool | ||||
if (exists(txid)) { | if (exists(txid)) { | ||||
m_unbroadcast_txids.insert(txid); | m_unbroadcast_txids.insert(txid); | ||||
} | } | ||||
} | } | ||||
/** Removes a transaction from the unbroadcast set */ | /** Removes a transaction from the unbroadcast set */ | ||||
void RemoveUnbroadcastTx(const TxId &txid, const bool unchecked = false); | void RemoveUnbroadcastTx(const TxId &txid, const bool unchecked = false); | ||||
/** Returns transactions in unbroadcast set */ | /** Returns transactions in unbroadcast set */ | ||||
std::set<TxId> GetUnbroadcastTxs() const { | std::set<TxId> GetUnbroadcastTxs() const { | ||||
LOCK(cs); | LOCK(cs); | ||||
return m_unbroadcast_txids; | return m_unbroadcast_txids; | ||||
} | } | ||||
// Returns if a txid is in the unbroadcast set | /** Returns whether a txid is in the unbroadcast set */ | ||||
bool IsUnbroadcastTx(const TxId &txid) const { | bool IsUnbroadcastTx(const TxId &txid) const { | ||||
LOCK(cs); | LOCK(cs); | ||||
return (m_unbroadcast_txids.count(txid) != 0); | return (m_unbroadcast_txids.count(txid) != 0); | ||||
} | } | ||||
private: | private: | ||||
/** | /** | ||||
* UpdateForDescendants is used by UpdateTransactionsFromBlock to update the | * UpdateForDescendants is used by UpdateTransactionsFromBlock to update the | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |