@@ -392,7 +392,7 @@ static void UpdateMempoolForReorg(DisconnectedBlockTransactions& disconnectpool,
392
392
// Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool
393
393
// were somehow broken and returning the wrong scriptPubKeys
394
394
static bool CheckInputsFromMempoolAndCache (const CTransaction& tx, CValidationState& state, const CCoinsViewCache& view, const CTxMemPool& pool,
395
- unsigned int flags, bool cacheSigStore, PrecomputedTransactionData& txdata) EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
395
+ unsigned int flags, PrecomputedTransactionData& txdata) EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
396
396
AssertLockHeld (cs_main);
397
397
398
398
// pool.cs should be locked already, but go ahead and re-take the lock here
@@ -422,7 +422,8 @@ static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, CValidationSt
422
422
}
423
423
}
424
424
425
- return CheckInputs (tx, state, view, flags, cacheSigStore, true , txdata);
425
+ // Call CheckInputs() to cache signature and script validity against current tip consensus rules.
426
+ return CheckInputs (tx, state, view, flags, /* cacheSigStore = */ true , /* cacheFullSciptStore = */ true , txdata);
426
427
}
427
428
428
429
namespace {
@@ -959,7 +960,7 @@ bool MemPoolAccept::ConsensusScriptChecks(ATMPArgs& args, Workspace& ws, Precomp
959
960
// invalid blocks (using TestBlockValidity), however allowing such
960
961
// transactions into the mempool can be exploited as a DoS attack.
961
962
unsigned int currentBlockScriptVerifyFlags = GetBlockScriptFlags (::ChainActive ().Tip (), chainparams.GetConsensus ());
962
- if (!CheckInputsFromMempoolAndCache (tx, state, m_view, m_pool, currentBlockScriptVerifyFlags, true , txdata)) {
963
+ if (!CheckInputsFromMempoolAndCache (tx, state, m_view, m_pool, currentBlockScriptVerifyFlags, txdata)) {
963
964
return error (" %s: BUG! PLEASE REPORT THIS! CheckInputs failed against latest-block but not STANDARD flags %s, %s" ,
964
965
__func__, hash.ToString (), FormatStateMessage (state));
965
966
}
0 commit comments