Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 747 Lines • ▼ Show 20 Lines | static bool AcceptToMemoryPoolWorker( | ||||
} | } | ||||
// Coinbase is only valid in a block, not as a loose transaction. | // Coinbase is only valid in a block, not as a loose transaction. | ||||
if (!CheckRegularTransaction(tx, state, true)) { | if (!CheckRegularTransaction(tx, state, true)) { | ||||
// state filled in by CheckRegularTransaction. | // state filled in by CheckRegularTransaction. | ||||
return false; | return false; | ||||
} | } | ||||
// After the May, 15 hard fork, we start accepting larger op_return. | |||||
const bool hasMonolith = IsMonolithEnabled(config, chainActive.Tip()); | |||||
// Rather not work on nonstandard transactions (unless -testnet/-regtest) | // Rather not work on nonstandard transactions (unless -testnet/-regtest) | ||||
std::string reason; | std::string reason; | ||||
if (fRequireStandard && !IsStandardTx(tx, reason, hasMonolith)) { | if (fRequireStandard && !IsStandardTx(tx, reason)) { | ||||
return state.DoS(0, false, REJECT_NONSTANDARD, reason); | return state.DoS(0, false, REJECT_NONSTANDARD, reason); | ||||
} | } | ||||
// Only accept nLockTime-using transactions that can be mined in the next | // Only accept nLockTime-using transactions that can be mined in the next | ||||
// block; we don't want our mempool filled up with transactions that can't | // block; we don't want our mempool filled up with transactions that can't | ||||
// be mined yet. | // be mined yet. | ||||
CValidationState ctxState; | CValidationState ctxState; | ||||
if (!ContextualCheckTransactionForCurrentBlock( | if (!ContextualCheckTransactionForCurrentBlock( | ||||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | // Check for conflicts with in-memory transactions | ||||
entry, setAncestors, nLimitAncestors, nLimitAncestorSize, | entry, setAncestors, nLimitAncestors, nLimitAncestorSize, | ||||
nLimitDescendants, nLimitDescendantSize, errString)) { | nLimitDescendants, nLimitDescendantSize, errString)) { | ||||
return state.DoS(0, false, REJECT_NONSTANDARD, | return state.DoS(0, false, REJECT_NONSTANDARD, | ||||
"too-long-mempool-chain", false, errString); | "too-long-mempool-chain", false, errString); | ||||
} | } | ||||
// 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 (hasMonolith) { | if (IsMonolithEnabled(config, chainActive.Tip())) { | ||||
extraFlags |= SCRIPT_ENABLE_MONOLITH_OPCODES; | extraFlags |= SCRIPT_ENABLE_MONOLITH_OPCODES; | ||||
} | } | ||||
if (IsReplayProtectionEnabledForCurrentBlock(config)) { | if (IsReplayProtectionEnabledForCurrentBlock(config)) { | ||||
extraFlags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | extraFlags |= SCRIPT_ENABLE_REPLAY_PROTECTION; | ||||
} | } | ||||
// Check inputs based on the set of flags we activate. | // Check inputs based on the set of flags we activate. | ||||
▲ Show 20 Lines • Show All 4,459 Lines • Show Last 20 Lines |