SelectCoinsMinConf: Prefer coins with fewer ancestors

This commit is contained in:
Gregory Sanders
2016-12-02 15:29:20 -05:00
committed by lateminer
parent db82c9a2cf
commit 8a0d1a55f9
6 changed files with 67 additions and 46 deletions

View File

@@ -1055,3 +1055,10 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<uint256>* pvNoSpendsRe
if (maxFeeRateRemoved > CFeeRate(0))
LogPrint("mempool", "Removed %u txn, rolling minimum fee bumped to %s\n", nTxnRemoved, maxFeeRateRemoved.ToString());
}
bool CTxMemPool::TransactionWithinChainLimit(const uint256& txid, size_t chainLimit) const {
LOCK(cs);
if (exists(txid) && std::max(mapTx.find(txid)->GetCountWithAncestors(), mapTx.find(txid)->GetCountWithDescendants()) >= chainLimit)
return false;
return true;
}