|
|
|
@ -314,7 +314,7 @@ CTxMemPool::CTxMemPool(const CFeeRate& _minReasonableRelayFee) :
@@ -314,7 +314,7 @@ CTxMemPool::CTxMemPool(const CFeeRate& _minReasonableRelayFee) :
|
|
|
|
|
// Sanity checks off by default for performance, because otherwise
|
|
|
|
|
// accepting transactions becomes O(N^2) where N is the number
|
|
|
|
|
// of transactions in the pool
|
|
|
|
|
fSanityCheck = false; |
|
|
|
|
nCheckFrequency = 0; |
|
|
|
|
|
|
|
|
|
minerPolicyEstimator = new CBlockPolicyEstimator(_minReasonableRelayFee); |
|
|
|
|
minReasonableRelayFee = _minReasonableRelayFee; |
|
|
|
@ -487,7 +487,7 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in
@@ -487,7 +487,7 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in
|
|
|
|
|
if (it2 != mapTx.end()) |
|
|
|
|
continue; |
|
|
|
|
const CCoins *coins = pcoins->AccessCoins(txin.prevout.hash); |
|
|
|
|
if (fSanityCheck) assert(coins); |
|
|
|
|
if (nCheckFrequency != 0) assert(coins); |
|
|
|
|
if (!coins || (coins->IsCoinBase() && ((signed long)nMemPoolHeight) - coins->nHeight < COINBASE_MATURITY)) { |
|
|
|
|
transactionsToRemove.push_back(tx); |
|
|
|
|
break; |
|
|
|
@ -568,7 +568,10 @@ void CTxMemPool::clear()
@@ -568,7 +568,10 @@ void CTxMemPool::clear()
|
|
|
|
|
|
|
|
|
|
void CTxMemPool::check(const CCoinsViewCache *pcoins) const |
|
|
|
|
{ |
|
|
|
|
if (!fSanityCheck) |
|
|
|
|
if (nCheckFrequency == 0) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (insecure_rand() >= nCheckFrequency) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
LogPrint("mempool", "Checking mempool with %u transactions and %u inputs\n", (unsigned int)mapTx.size(), (unsigned int)mapNextTx.size()); |
|
|
|
|