From 8f188ece3c82c4cf5d52a3363e7643c23169c0ff Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 21 Mar 2012 15:45:58 -0400 Subject: [PATCH] Remove -bip16 and -paytoscripthashtime command-line arguments --- src/init.cpp | 23 +++++------------------ src/main.cpp | 9 +++------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index a5db20b..81e98fe 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -489,24 +489,11 @@ bool AppInit2(int argc, char* argv[]) fAllowDNS = GetBoolArg("-dns"); fNoListen = !GetBoolArg("-listen", true); - // This code can be removed once a super-majority of the network has upgraded. - if (GetBoolArg("-bip16", true)) - { - if (fTestNet) - SoftSetArg("-paytoscripthashtime", "1329264000"); // Feb 15 - else - SoftSetArg("-paytoscripthashtime", "1333238400"); // April 1 2012 - - // Put "/P2SH/" in the coinbase so everybody can tell when - // a majority of miners support it - const char* pszP2SH = "/P2SH/"; - COINBASE_FLAGS << std::vector(pszP2SH, pszP2SH+strlen(pszP2SH)); - } - else - { - const char* pszP2SH = "NOP2SH"; - COINBASE_FLAGS << std::vector(pszP2SH, pszP2SH+strlen(pszP2SH)); - } + // Continue to put "/P2SH/" in the coinbase to monitor + // BIP16 support. + // This can be removed eventually... + const char* pszP2SH = "/P2SH/"; + COINBASE_FLAGS << std::vector(pszP2SH, pszP2SH+strlen(pszP2SH)); if (!fNoListen) { diff --git a/src/main.cpp b/src/main.cpp index 491044e..efbaea1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1278,12 +1278,9 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex) return false; } - // To avoid being on the short end of a block-chain split, - // don't do secondary validation of pay-to-script-hash transactions - // until blocks with timestamps after paytoscripthashtime (see init.cpp for default). - // This code can be removed once a super-majority of the network has upgraded. - int64 nEvalSwitchTime = GetArg("-paytoscripthashtime", std::numeric_limits::max()); - bool fStrictPayToScriptHash = (pindex->nTime >= nEvalSwitchTime); + // BIP16 didn't become active until Apr 1 2012 (Feb 15 on testnet) + int64 nBIP16SwitchTime = fTestNet ? 1329264000 : 1333238400; + bool fStrictPayToScriptHash = (pindex->nTime >= nBIP16SwitchTime); //// issue here: it doesn't know the version unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK) - 1 + GetSizeOfCompactSize(vtx.size()); -- 1.7.1