Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 713 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
extraFlags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | extraFlags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | ||||
} | } | ||||
if (IsMagneticAnomalyEnabledForCurrentBlock(config)) { | if (IsMagneticAnomalyEnabledForCurrentBlock(config)) { | ||||
extraFlags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; | extraFlags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; | ||||
} | } | ||||
if (IsGreatWallEnabledForCurrentBlock(config)) { | if (IsGreatWallEnabledForCurrentBlock(config)) { | ||||
if (fRequireStandard) { | |||||
extraFlags |= SCRIPT_DISALLOW_SEGWIT_RECOVERY; | |||||
} | |||||
extraFlags |= SCRIPT_ENABLE_SCHNORR; | extraFlags |= SCRIPT_ENABLE_SCHNORR; | ||||
} else { | } | ||||
if (fRequireStandard) { | |||||
extraFlags |= SCRIPT_DISALLOW_SEGWIT_RECOVERY; | extraFlags |= SCRIPT_DISALLOW_SEGWIT_RECOVERY; | ||||
} | } | ||||
// Make sure whatever we need to activate is actually activated. | // Make sure whatever we need to activate is actually activated. | ||||
const uint32_t scriptVerifyFlags = | const uint32_t scriptVerifyFlags = | ||||
STANDARD_SCRIPT_VERIFY_FLAGS | extraFlags; | STANDARD_SCRIPT_VERIFY_FLAGS | extraFlags; | ||||
// Check against previous transactions. This is done last to help | // Check against previous transactions. This is done last to help | ||||
▲ Show 20 Lines • Show All 882 Lines • ▼ Show 20 Lines | static uint32_t GetBlockScriptFlags(const Config &config, | ||||
// alternative. We also start enforcing push only signatures and | // alternative. We also start enforcing push only signatures and | ||||
// clean stack. | // clean stack. | ||||
if (IsMagneticAnomalyEnabled(config, pChainTip)) { | if (IsMagneticAnomalyEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; | flags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; | ||||
flags |= SCRIPT_VERIFY_SIGPUSHONLY; | flags |= SCRIPT_VERIFY_SIGPUSHONLY; | ||||
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 | ||||
// 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. | ||||
if (IsGreatWallEnabled(config, pChainTip)) { | if (IsGreatWallEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_ENABLE_SCHNORR; | flags |= SCRIPT_ENABLE_SCHNORR; | ||||
} else { | |||||
flags |= SCRIPT_DISALLOW_SEGWIT_RECOVERY; | |||||
} | } | ||||
// 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 4,013 Lines • Show Last 20 Lines |