Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 455 Lines • ▼ Show 20 Lines | |||||
static bool | static bool | ||||
IsMagneticAnomalyEnabledForCurrentBlock(const Consensus::Params ¶ms) | IsMagneticAnomalyEnabledForCurrentBlock(const Consensus::Params ¶ms) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
return IsMagneticAnomalyEnabled(params, chainActive.Tip()); | return IsMagneticAnomalyEnabled(params, chainActive.Tip()); | ||||
} | } | ||||
static bool IsGravitonEnabledForCurrentBlock(const Consensus::Params ¶ms) | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | |||||
AssertLockHeld(cs_main); | |||||
return IsGravitonEnabled(params, chainActive.Tip()); | |||||
} | |||||
// Command-line argument "-replayprotectionactivationtime=<timestamp>" will | // Command-line argument "-replayprotectionactivationtime=<timestamp>" will | ||||
// cause the node to switch to replay protected SigHash ForkID value when the | // cause the node to switch to replay protected SigHash ForkID value when the | ||||
// median timestamp of the previous 11 blocks is greater than or equal to | // median timestamp of the previous 11 blocks is greater than or equal to | ||||
// <timestamp>. Defaults to the pre-defined timestamp when not set. | // <timestamp>. Defaults to the pre-defined timestamp when not set. | ||||
static bool IsReplayProtectionEnabled(const Consensus::Params ¶ms, | static bool IsReplayProtectionEnabled(const Consensus::Params ¶ms, | ||||
int64_t nMedianTimePast) { | int64_t nMedianTimePast) { | ||||
return nMedianTimePast >= gArgs.GetArg("-replayprotectionactivationtime", | return nMedianTimePast >= gArgs.GetArg("-replayprotectionactivationtime", | ||||
params.phononActivationTime); | params.phononActivationTime); | ||||
▲ Show 20 Lines • Show All 312 Lines • ▼ Show 20 Lines | for (const CTxIn &txin : tx.vin) { | ||||
// invalid blocks (using TestBlockValidity), however allowing such | // invalid blocks (using TestBlockValidity), however allowing such | ||||
// transactions into the mempool can be exploited as a DoS attack. | // transactions into the mempool can be exploited as a DoS attack. | ||||
uint32_t nextBlockScriptVerifyFlags = | uint32_t nextBlockScriptVerifyFlags = | ||||
GetNextBlockScriptFlags(consensusParams, chainActive.Tip()); | GetNextBlockScriptFlags(consensusParams, chainActive.Tip()); | ||||
if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, | if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, | ||||
nextBlockScriptVerifyFlags, true, | nextBlockScriptVerifyFlags, true, | ||||
txdata)) { | txdata)) { | ||||
// This can occur under some circumstances, if the node receives an | |||||
// unrequested tx which is invalid due to new consensus rules not | |||||
// being activated yet (during IBD). | |||||
return error("%s: BUG! PLEASE REPORT THIS! CheckInputs failed " | return error("%s: BUG! PLEASE REPORT THIS! CheckInputs failed " | ||||
"against next-block but not STANDARD flags %s, %s", | "against next-block but not STANDARD flags %s, %s", | ||||
__func__, txid.ToString(), FormatStateMessage(state)); | __func__, txid.ToString(), FormatStateMessage(state)); | ||||
} | } | ||||
if (test_accept) { | if (test_accept) { | ||||
// Tx was accepted, but not added | // Tx was accepted, but not added | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 4,869 Lines • Show Last 20 Lines |