aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-10-13 11:35:18 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2017-11-06 19:09:12 -0800
commit18e071841e83044b47aa45c3e98c0796a407d445 (patch)
treeec4f134a88e4a6c451ffc815763c69d9d6bc356e /src/validation.cpp
parent526023aa7a99955dffcd406224963e6c193c1ddf (diff)
downloadbitcoin-18e071841e83044b47aa45c3e98c0796a407d445.tar.xz
[consensus] Pin P2SH activation to block 173805 on mainnet
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 866e0c9fba..f0c05e92f2 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1590,11 +1590,12 @@ static ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS];
static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Params& consensusparams) {
AssertLockHeld(cs_main);
- // BIP16 didn't become active until Apr 1 2012
- int64_t nBIP16SwitchTime = 1333238400;
- bool fStrictPayToScriptHash = (pindex->GetBlockTime() >= nBIP16SwitchTime);
+ unsigned int flags = SCRIPT_VERIFY_NONE;
- unsigned int flags = fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE;
+ // Start enforcing P2SH (BIP16)
+ if (pindex->nHeight >= consensusparams.BIP16Height) {
+ flags |= SCRIPT_VERIFY_P2SH;
+ }
// Start enforcing the DERSIG (BIP66) rule
if (pindex->nHeight >= consensusparams.BIP66Height) {