Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 688 Lines • ▼ Show 20 Lines | void UpdateMempoolForReorg(const Config &config, | ||||
LimitMempoolSize( | LimitMempoolSize( | ||||
mempool, | mempool, | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, | ||||
gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); | gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); | ||||
} | } | ||||
// Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool | // Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool | ||||
// were somehow broken and returning the wrong scriptPubKeys | // were somehow broken and returning the wrong scriptPubKeys | ||||
static bool CheckInputsFromMempoolAndCache(const CTransaction &tx, | static bool | ||||
CValidationState &state, | CheckInputsFromMempoolAndCache(const CTransaction &tx, CValidationState &state, | ||||
const CCoinsViewCache &view, | const CCoinsViewCache &view, CTxMemPool &pool, | ||||
CTxMemPool &pool, uint32_t flags, | const uint32_t flags, bool cacheSigStore, | ||||
bool cacheSigStore, | |||||
PrecomputedTransactionData &txdata) { | PrecomputedTransactionData &txdata) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
// pool.cs should be locked already, but go ahead and re-take the lock here | // pool.cs should be locked already, but go ahead and re-take the lock here | ||||
// to enforce that mempool doesn't change between when we check the view and | // to enforce that mempool doesn't change between when we check the view and | ||||
// when we actually call through to CheckInputs | // when we actually call through to CheckInputs | ||||
LOCK(pool.cs); | LOCK(pool.cs); | ||||
assert(!tx.IsCoinBase()); | assert(!tx.IsCoinBase()); | ||||
▲ Show 20 Lines • Show All 794 Lines • ▼ Show 20 Lines | bool CheckTxInputs(const CTransaction &tx, CValidationState &state, | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
} // namespace Consensus | } // namespace Consensus | ||||
bool CheckInputs(const CTransaction &tx, CValidationState &state, | bool CheckInputs(const CTransaction &tx, CValidationState &state, | ||||
const CCoinsViewCache &inputs, bool fScriptChecks, | const CCoinsViewCache &inputs, bool fScriptChecks, | ||||
uint32_t flags, bool sigCacheStore, bool scriptCacheStore, | const uint32_t flags, bool sigCacheStore, | ||||
bool scriptCacheStore, | |||||
const PrecomputedTransactionData &txdata, | const PrecomputedTransactionData &txdata, | ||||
std::vector<CScriptCheck> *pvChecks) { | std::vector<CScriptCheck> *pvChecks) { | ||||
assert(!tx.IsCoinBase()); | assert(!tx.IsCoinBase()); | ||||
if (!Consensus::CheckTxInputs(tx, state, inputs, GetSpendHeight(inputs))) { | if (!Consensus::CheckTxInputs(tx, state, inputs, GetSpendHeight(inputs))) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,898 Lines • Show Last 20 Lines |