mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 06:30:10 +01:00
Merge #11389: Support having SegWit always active in regtest (sipa, ajtowns, jnewbery)
d61845818Have SegWit active by default (Pieter Wuille)4bd89210aUnit tests for always-active versionbits. (Anthony Towns)d07ee77abAlways-active versionbits support (Pieter Wuille)18e071841[consensus] Pin P2SH activation to block 173805 on mainnet (John Newbery)526023aa7Improve handling of BIP9Deployment limits (Anthony Towns) Pull request description: Most tests shouldn't have to deal with the now-historical SegWit activation transition (and other deployments, but SegWit is certainly the hardest one to accomodate). This PR makes a versionbits starttime of -1 equal to "always active", and enables it by default for SegWit on regtest. Individual tests can override this by using the existing `-vbparams` option. A few unit tests and functional tests are adapted to indeed override vbparams, as they specifically test the transition. This is in preparation for wallet SegWit support, but I thought having earlier eyes on it would be useful. Tree-SHA512: 3f07a7b41cf46476e6c7a5c43244e68c9f41d223482cedaa4c02a3a7b7cd0e90cbd06b84a1f3704620559636a2268f5767d4c52d09c1b354945737046f618fe5
This commit is contained in:
@@ -1611,11 +1611,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) {
|
||||
|
||||
Reference in New Issue
Block a user