mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-18 02:51:06 +00:00
Add TxPriority class and comparator
This commit is contained in:
parent
f3fe83673e
commit
7230187b1d
@ -587,4 +587,17 @@ public:
|
|||||||
bool HaveCoins(const uint256 &txid) const;
|
bool HaveCoins(const uint256 &txid) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
return CompareTxMemPoolEntryByScore()(*(b.second), *(a.second)); //Reverse order to make sort less than
|
||||||
|
return a.first < b.first;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#endif // BITCOIN_TXMEMPOOL_H
|
#endif // BITCOIN_TXMEMPOOL_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user