Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 1,551 Lines • ▼ Show 20 Lines | |||||
static uint32_t GetNextBlockScriptFlags(const Config &config, | static uint32_t GetNextBlockScriptFlags(const Config &config, | ||||
const CBlockIndex *pindex) { | const CBlockIndex *pindex) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
const Consensus::Params &consensusParams = | const Consensus::Params &consensusParams = | ||||
config.GetChainParams().GetConsensus(); | config.GetChainParams().GetConsensus(); | ||||
uint32_t flags = SCRIPT_VERIFY_NONE; | uint32_t flags = SCRIPT_VERIFY_NONE; | ||||
// P2SH didn't become active until Apr 1 2012 | // Start enforcing P2SH (BIP16) | ||||
if (pindex->GetMedianTimePast() >= P2SH_ACTIVATION_TIME) { | if ((pindex->nHeight + 1) >= consensusParams.BIP16Height) { | ||||
flags |= SCRIPT_VERIFY_P2SH; | flags |= SCRIPT_VERIFY_P2SH; | ||||
} | } | ||||
// Start enforcing the DERSIG (BIP66) rule. | // Start enforcing the DERSIG (BIP66) rule. | ||||
if ((pindex->nHeight + 1) >= consensusParams.BIP66Height) { | if ((pindex->nHeight + 1) >= consensusParams.BIP66Height) { | ||||
flags |= SCRIPT_VERIFY_DERSIG; | flags |= SCRIPT_VERIFY_DERSIG; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,057 Lines • Show Last 20 Lines |