Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 972 Lines • ▼ Show 20 Lines | // Check for conflicts with in-memory transactions | ||||
// Set extraFlags as a set of flags that needs to be activated. | // Set extraFlags as a set of flags that needs to be activated. | ||||
uint32_t extraFlags = SCRIPT_VERIFY_NONE; | uint32_t extraFlags = SCRIPT_VERIFY_NONE; | ||||
if (IsReplayProtectionEnabledForCurrentBlock(config)) { | if (IsReplayProtectionEnabledForCurrentBlock(config)) { | ||||
extraFlags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | extraFlags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | ||||
} | } | ||||
if (IsMagneticAnomalyEnabledForCurrentBlock(config)) { | if (IsMagneticAnomalyEnabledForCurrentBlock(config)) { | ||||
extraFlags |= SCRIPT_ENABLE_CHECKDATASIG; | extraFlags |= SCRIPT_ENABLE_MAGNETIC_OPCODES; | ||||
} | } | ||||
// 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 931 Lines • ▼ Show 20 Lines | static uint32_t GetBlockScriptFlags(const Config &config, | ||||
// to fail (for instance in multisig or other forms of smart contracts) are | // to fail (for instance in multisig or other forms of smart contracts) are | ||||
// null. | // null. | ||||
if (IsDAAEnabled(config, pChainTip)) { | if (IsDAAEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_VERIFY_LOW_S; | flags |= SCRIPT_VERIFY_LOW_S; | ||||
flags |= SCRIPT_VERIFY_NULLFAIL; | flags |= SCRIPT_VERIFY_NULLFAIL; | ||||
} | } | ||||
// When the magnetic anomaly fork is enabled, we start accepting | // When the magnetic anomaly fork is enabled, we start accepting | ||||
// transactions using the OP_CHECKDATASIG opcode and it's verify | // transactions using the OP_CHECKDATASIG opcode, it's verify | ||||
// alternative. We also start enforcing push only signatures. | // alternative, and the re-enabled opcodes. We also start enforcing push | ||||
// only signatures. | |||||
if (IsMagneticAnomalyEnabled(config, pChainTip)) { | if (IsMagneticAnomalyEnabled(config, pChainTip)) { | ||||
flags |= SCRIPT_ENABLE_CHECKDATASIG; | flags |= SCRIPT_ENABLE_MAGNETIC_OPCODES; | ||||
flags |= SCRIPT_VERIFY_SIGPUSHONLY; | flags |= SCRIPT_VERIFY_SIGPUSHONLY; | ||||
} | } | ||||
// 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,637 Lines • Show Last 20 Lines |