Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
SaltedTxidHasher(); | SaltedTxidHasher(); | ||||
size_t operator()(const uint256 &txid) const { | size_t operator()(const uint256 &txid) const { | ||||
return SipHashUint256(k0, k1, txid); | return SipHashUint256(k0, k1, txid); | ||||
} | } | ||||
}; | }; | ||||
typedef std::pair<double, Amount> TXModifier; | |||||
/** | /** | ||||
* CTxMemPool stores valid-according-to-the-current-best-chain transactions that | * CTxMemPool stores valid-according-to-the-current-best-chain transactions that | ||||
* may be included in the next block. | * may be included in the next block. | ||||
* | * | ||||
* Transactions are added when they are seen on the network (or created by the | * Transactions are added when they are seen on the network (or created by the | ||||
* local node), but not all transactions seen are added to the pool. For | * local node), but not all transactions seen are added to the pool. For | ||||
* example, the following new transactions will not be added to the mempool: | * example, the following new transactions will not be added to the mempool: | ||||
* - a transaction which doesn't meet the minimum fee requirements. | * - a transaction which doesn't meet the minimum fee requirements. | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | private: | ||||
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; | GetSortedDepthAndScore() const; | ||||
public: | public: | ||||
indirectmap<COutPoint, const CTransaction *> mapNextTx; | indirectmap<COutPoint, const CTransaction *> mapNextTx; | ||||
std::map<uint256, std::pair<double, Amount>> mapDeltas; | std::map<uint256, TXModifier> mapDeltas; | ||||
/** Create a new CTxMemPool. | /** Create a new CTxMemPool. | ||||
*/ | */ | ||||
CTxMemPool(); | CTxMemPool(); | ||||
~CTxMemPool(); | ~CTxMemPool(); | ||||
/** | /** | ||||
* If sanity-checking is turned on, check makes sure the pool is consistent | * If sanity-checking is turned on, check makes sure the pool is consistent | ||||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |