Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 639 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
extraFlags |= SCRIPT_ENABLE_CHECKDATASIG; | extraFlags |= SCRIPT_ENABLE_CHECKDATASIG; | ||||
} | } | ||||
if (IsGreatWallEnabledForCurrentBlock(config)) { | if (IsGreatWallEnabledForCurrentBlock(config)) { | ||||
if (!fRequireStandard) { | if (!fRequireStandard) { | ||||
extraFlags |= SCRIPT_ALLOW_SEGWIT_RECOVERY; | extraFlags |= SCRIPT_ALLOW_SEGWIT_RECOVERY; | ||||
} | } | ||||
extraFlags |= SCRIPT_ENABLE_SCHNORR; | extraFlags |= SCRIPT_ENABLE_SCHNORR; | ||||
extraFlags |= SCRIPT_VERIFY_NULLDUMMY; | |||||
} | } | ||||
// Check inputs based on the set of flags we activate. | // Check inputs based on the set of flags we activate. | ||||
uint32_t scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS; | uint32_t scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS; | ||||
if (!config.GetChainParams().RequireStandard()) { | if (!config.GetChainParams().RequireStandard()) { | ||||
scriptVerifyFlags = | scriptVerifyFlags = | ||||
SCRIPT_ENABLE_SIGHASH_FORKID | | SCRIPT_ENABLE_SIGHASH_FORKID | | ||||
gArgs.GetArg("-promiscuousmempoolflags", scriptVerifyFlags); | gArgs.GetArg("-promiscuousmempoolflags", scriptVerifyFlags); | ||||
▲ Show 20 Lines • Show All 951 Lines • ▼ Show 20 Lines | if (IsMagneticAnomalyEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_VERIFY_CLEANSTACK; | flags |= SCRIPT_VERIFY_CLEANSTACK; | ||||
} | } | ||||
// If the Great Wall fork is enabled, we start accepting transactions | // If the Great Wall fork is enabled, we start accepting transactions | ||||
// recovering coins sent to segwit addresses. We also start accepting | // recovering coins sent to segwit addresses. We also start accepting | ||||
// 65/64-byte Schnorr signatures in CHECKSIG and CHECKDATASIG respectively, | // 65/64-byte Schnorr signatures in CHECKSIG and CHECKDATASIG respectively, | ||||
// and their verify variants. We also stop accepting 65 byte signatures in | // and their verify variants. We also stop accepting 65 byte signatures in | ||||
// CHECKMULTISIG and its verify variant. | // CHECKMULTISIG and its verify variant. | ||||
// Great Wall fork also enforces NULLDUMMY verification to deal with dummy | |||||
// stack element malleablility. | |||||
if (IsGreatWallEnabled(config, pChainTip)) { | if (IsGreatWallEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_ALLOW_SEGWIT_RECOVERY; | flags |= SCRIPT_ALLOW_SEGWIT_RECOVERY; | ||||
flags |= SCRIPT_ENABLE_SCHNORR; | flags |= SCRIPT_ENABLE_SCHNORR; | ||||
flags |= SCRIPT_VERIFY_NULLDUMMY; | |||||
} | } | ||||
// We make sure this node will have replay protection during the next hard | // We make sure this node will have replay protection during the next hard | ||||
// fork. | // fork. | ||||
if (IsReplayProtectionEnabled(config, pChainTip)) { | if (IsReplayProtectionEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | flags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,957 Lines • Show Last 20 Lines |