Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
return state.DoS(0, false, REJECT_NONSTANDARD, | return state.DoS(0, false, REJECT_NONSTANDARD, | ||||
"bad-txns-too-many-sigops", false, | "bad-txns-too-many-sigops", false, | ||||
strprintf("%d", nSigOpsCount)); | strprintf("%d", nSigOpsCount)); | ||||
} | } | ||||
CFeeRate minRelayTxFee = config.GetMinFeePerKB(); | CFeeRate minRelayTxFee = config.GetMinFeePerKB(); | ||||
Amount mempoolRejectFee = | Amount mempoolRejectFee = | ||||
pool.GetMinFee( | pool.GetMinFee( | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE)) | ||||
1000000) | |||||
.GetFee(nSize); | .GetFee(nSize); | ||||
if (mempoolRejectFee > Amount::zero() && | if (mempoolRejectFee > Amount::zero() && | ||||
nModifiedFees < mempoolRejectFee) { | nModifiedFees < mempoolRejectFee) { | ||||
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, | return state.DoS(0, false, REJECT_INSUFFICIENTFEE, | ||||
"mempool min fee not met", false, | "mempool min fee not met", false, | ||||
strprintf("%d < %d", nFees, mempoolRejectFee)); | strprintf("%d < %d", nFees, mempoolRejectFee)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx); | IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx); | ||||
// Store transaction in memory. | // Store transaction in memory. | ||||
pool.addUnchecked(txid, entry, setAncestors, validForFeeEstimation); | pool.addUnchecked(txid, entry, setAncestors, validForFeeEstimation); | ||||
// Trim mempool and check if tx was trimmed. | // Trim mempool and check if tx was trimmed. | ||||
if (!fOverrideMempoolLimit) { | if (!fOverrideMempoolLimit) { | ||||
pool.LimitSize( | pool.LimitSize( | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE), | ||||
gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * | gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * | ||||
60); | 60); | ||||
if (!pool.exists(txid)) { | if (!pool.exists(txid)) { | ||||
return state.DoS(0, false, REJECT_INSUFFICIENTFEE, | return state.DoS(0, false, REJECT_INSUFFICIENTFEE, | ||||
"mempool full"); | "mempool full"); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,262 Lines • ▼ Show 20 Lines | try { | ||||
} | } | ||||
if (nLastFlush == 0) { | if (nLastFlush == 0) { | ||||
nLastFlush = nNow; | nLastFlush = nNow; | ||||
} | } | ||||
if (nLastSetChain == 0) { | if (nLastSetChain == 0) { | ||||
nLastSetChain = nNow; | nLastSetChain = nNow; | ||||
} | } | ||||
int64_t nMempoolSizeMax = | int64_t nMempoolSizeMax = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); | ||||
int64_t cacheSize = pcoinsTip->DynamicMemoryUsage(); | int64_t cacheSize = pcoinsTip->DynamicMemoryUsage(); | ||||
int64_t nTotalSpace = | int64_t nTotalSpace = | ||||
nCoinCacheUsage + | nCoinCacheUsage + | ||||
std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0); | std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0); | ||||
// The cache is large and we're within 10% and 10 MiB of the limit, | // The cache is large and we're within 10% and 10 MiB of the limit, | ||||
// but we have time now (not in the middle of a block processing). | // but we have time now (not in the middle of a block processing). | ||||
bool fCacheLarge = | bool fCacheLarge = | ||||
mode == FLUSH_STATE_PERIODIC && | mode == FLUSH_STATE_PERIODIC && | ||||
▲ Show 20 Lines • Show All 3,573 Lines • Show Last 20 Lines |