Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | static bool IsReplayProtectionEnabled(const Consensus::Params ¶ms, | ||||
return IsReplayProtectionEnabled(params, pindexPrev->GetMedianTimePast()); | return IsReplayProtectionEnabled(params, pindexPrev->GetMedianTimePast()); | ||||
} | } | ||||
// Returns the script flags which should be checked for mempool admission when | // Returns the script flags which should be checked for mempool admission when | ||||
// the tip is at the given block. | // the tip is at the given block. | ||||
static uint32_t GetStandardScriptFlags(const Consensus::Params ¶ms, | static uint32_t GetStandardScriptFlags(const Consensus::Params ¶ms, | ||||
const CBlockIndex *pindexTip) { | const CBlockIndex *pindexTip) { | ||||
uint32_t flags = STANDARD_SCRIPT_VERIFY_FLAGS; | // Use the consensus flags for the next block as a basis, and mix in the | ||||
// declared-standard flags. | |||||
uint32_t flags = GetNextBlockScriptFlags(params, pindexTip) | | |||||
STANDARD_SCRIPT_VERIFY_FLAGS; | |||||
// Disable input sigchecks limit for mempool admission, prior to its | // Disable input sigchecks limit for mempool admission, prior to its | ||||
// proper activation. | // proper activation. | ||||
flags &= ~SCRIPT_VERIFY_INPUT_SIGCHECKS; | flags &= ~SCRIPT_VERIFY_INPUT_SIGCHECKS; | ||||
// We make sure this node will have replay protection during the next hard | |||||
// fork. | |||||
if (IsReplayProtectionEnabled(params, pindexTip)) { | |||||
flags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | |||||
} | |||||
return flags; | return flags; | ||||
} | } | ||||
// 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( | static bool CheckInputsFromMempoolAndCache( | ||||
const CTransaction &tx, CValidationState &state, | const CTransaction &tx, CValidationState &state, | ||||
const CCoinsViewCache &view, const CTxMemPool &pool, const uint32_t flags, | const CCoinsViewCache &view, const CTxMemPool &pool, const uint32_t flags, | ||||
▲ Show 20 Lines • Show All 5,298 Lines • Show Last 20 Lines |