aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorDhruv Mehta <856960+dhruv@users.noreply.github.com>2021-06-20 11:15:57 -0700
committerDhruv Mehta <856960+dhruv@users.noreply.github.com>2021-07-07 22:13:01 -0700
commit189128c220190a588500b8e74ee7ae47671b9558 (patch)
tree31fd86f60b4f7580b2cd55ccdd765281ed1c67bd /src/validation.cpp
parentac82b99db77ec843af82dcdf040dfdbc98c8ff26 (diff)
downloadbitcoin-189128c220190a588500b8e74ee7ae47671b9558.tar.xz
[validation] Set witness script flag with p2sh for blocks
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 65d2dfa3b7..863483bcfb 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1646,13 +1646,8 @@ static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consens
pindex->phashBlock == nullptr || // this is a new candidate block, eg from TestBlockValidity()
*pindex->phashBlock != consensusparams.BIP16Exception) // this block isn't the historical exception
{
- flags |= SCRIPT_VERIFY_P2SH;
- }
-
- // Enforce WITNESS rules whenever P2SH is in effect (and the segwit
- // deployment is defined).
- if (flags & SCRIPT_VERIFY_P2SH && DeploymentEnabled(consensusparams, Consensus::DEPLOYMENT_SEGWIT)) {
- flags |= SCRIPT_VERIFY_WITNESS;
+ // Enforce WITNESS rules whenever P2SH is in effect
+ flags |= SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS;
}
// Enforce the DERSIG (BIP66) rule