Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 811 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/** | /** | ||||
* (try to) add transaction to memory pool with a specified acceptance time. | * (try to) add transaction to memory pool with a specified acceptance time. | ||||
*/ | */ | ||||
static bool AcceptToMemoryPoolWithTime( | static bool AcceptToMemoryPoolWithTime( | ||||
const Config &config, CTxMemPool &pool, CValidationState &state, | const Config &config, CTxMemPool &pool, CValidationState &state, | ||||
const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, | const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, | ||||
int64_t nAcceptTime, bool fOverrideMempoolLimit = false, | int64_t nAcceptTime, bool fOverrideMempoolLimit, const Amount nAbsurdFee) { | ||||
const Amount nAbsurdFee = Amount::zero()) { | |||||
std::vector<COutPoint> coins_to_uncache; | std::vector<COutPoint> coins_to_uncache; | ||||
bool res = AcceptToMemoryPoolWorker( | bool res = AcceptToMemoryPoolWorker( | ||||
config, pool, state, tx, fLimitFree, pfMissingInputs, nAcceptTime, | config, pool, state, tx, fLimitFree, pfMissingInputs, nAcceptTime, | ||||
fOverrideMempoolLimit, nAbsurdFee, coins_to_uncache); | fOverrideMempoolLimit, nAbsurdFee, coins_to_uncache); | ||||
if (!res) { | if (!res) { | ||||
for (const COutPoint &outpoint : coins_to_uncache) { | for (const COutPoint &outpoint : coins_to_uncache) { | ||||
pcoinsTip->Uncache(outpoint); | pcoinsTip->Uncache(outpoint); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,768 Lines • ▼ Show 20 Lines | try { | ||||
Amount amountdelta = nFeeDelta * SATOSHI; | Amount amountdelta = nFeeDelta * SATOSHI; | ||||
if (amountdelta != Amount::zero()) { | if (amountdelta != Amount::zero()) { | ||||
g_mempool.PrioritiseTransaction(tx->GetId(), prioritydummy, | g_mempool.PrioritiseTransaction(tx->GetId(), prioritydummy, | ||||
amountdelta); | amountdelta); | ||||
} | } | ||||
CValidationState state; | CValidationState state; | ||||
if (nTime + nExpiryTimeout > nNow) { | if (nTime + nExpiryTimeout > nNow) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
AcceptToMemoryPoolWithTime(config, g_mempool, state, tx, true, | AcceptToMemoryPoolWithTime(config, g_mempool, state, tx, | ||||
nullptr, nTime); | true /* fLimitFree */, | ||||
nullptr /* pfMissingInputs */, nTime, | |||||
false /* fOverrideMempoolLimit */, | |||||
Amount::zero() /* nAbsurdFee */); | |||||
if (state.IsValid()) { | if (state.IsValid()) { | ||||
++count; | ++count; | ||||
} else { | } else { | ||||
++failed; | ++failed; | ||||
} | } | ||||
} else { | } else { | ||||
++skipped; | ++skipped; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |