Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 803 Lines • ▼ Show 20 Lines | protected: | ||||
const CTxMemPool &mempool; | const CTxMemPool &mempool; | ||||
public: | public: | ||||
CCoinsViewMemPool(CCoinsView *baseIn, const CTxMemPool &mempoolIn); | CCoinsViewMemPool(CCoinsView *baseIn, const CTxMemPool &mempoolIn); | ||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; | bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; | ||||
bool HaveCoin(const COutPoint &outpoint) const override; | bool HaveCoin(const COutPoint &outpoint) const override; | ||||
}; | }; | ||||
// We want to sort transactions by coin age priority | |||||
typedef std::pair<double, CTxMemPool::txiter> TxCoinAgePriority; | |||||
struct TxCoinAgePriorityCompare { | |||||
bool operator()(const TxCoinAgePriority &a, const TxCoinAgePriority &b) { | |||||
if (a.first == b.first) { | |||||
// Reverse order to make sort less than | |||||
return CompareTxMemPoolEntryByScore()(*(b.second), *(a.second)); | |||||
} | |||||
return a.first < b.first; | |||||
} | |||||
}; | |||||
/** | /** | ||||
* DisconnectedBlockTransactions | * DisconnectedBlockTransactions | ||||
* | * | ||||
* During the reorg, it's desirable to re-add previously confirmed transactions | * During the reorg, it's desirable to re-add previously confirmed transactions | ||||
* to the mempool, so that anything not re-confirmed in the new chain is | * to the mempool, so that anything not re-confirmed in the new chain is | ||||
* available to be mined. However, it's more efficient to wait until the reorg | * available to be mined. However, it's more efficient to wait until the reorg | ||||
* is complete and process all still-unconfirmed transactions at that time, | * is complete and process all still-unconfirmed transactions at that time, | ||||
* since we expect most confirmed transactions to (typically) still be | * since we expect most confirmed transactions to (typically) still be | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |