Skip to content

Commit 189128c

Browse files
committed
[validation] Set witness script flag with p2sh for blocks
1 parent ac82b99 commit 189128c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/validation.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,13 +1646,8 @@ static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consens
16461646
pindex->phashBlock == nullptr || // this is a new candidate block, eg from TestBlockValidity()
16471647
*pindex->phashBlock != consensusparams.BIP16Exception) // this block isn't the historical exception
16481648
{
1649-
flags |= SCRIPT_VERIFY_P2SH;
1650-
}
1651-
1652-
// Enforce WITNESS rules whenever P2SH is in effect (and the segwit
1653-
// deployment is defined).
1654-
if (flags & SCRIPT_VERIFY_P2SH && DeploymentEnabled(consensusparams, Consensus::DEPLOYMENT_SEGWIT)) {
1655-
flags |= SCRIPT_VERIFY_WITNESS;
1649+
// Enforce WITNESS rules whenever P2SH is in effect
1650+
flags |= SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS;
16561651
}
16571652

16581653
// Enforce the DERSIG (BIP66) rule

0 commit comments

Comments
 (0)