Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 641 Lines • ▼ Show 20 Lines | static bool AcceptToMemoryPoolWorker( | ||||
std::string reason; | std::string reason; | ||||
if (fRequireStandard && !IsStandardTx(tx, reason)) { | 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; | |||||
if (!ContextualCheckTransactionForCurrentBlock( | if (!ContextualCheckTransactionForCurrentBlock( | ||||
config, tx, state, config.GetChainParams().GetConsensus(), | config, tx, ctxState, config.GetChainParams().GetConsensus(), | ||||
STANDARD_LOCKTIME_VERIFY_FLAGS)) { | STANDARD_LOCKTIME_VERIFY_FLAGS)) { | ||||
return state.DoS(0, false, REJECT_NONSTANDARD, "non-final"); | // We copy the state from a dummy to ensure we don't increase the | ||||
// ban score of peer for transaction that could be valid in the future. | |||||
return state.DoS( | |||||
0, false, REJECT_NONSTANDARD, ctxState.GetRejectReason(), | |||||
ctxState.CorruptionPossible(), ctxState.GetDebugMessage()); | |||||
} | } | ||||
// Is it already in the memory pool? | // Is it already in the memory pool? | ||||
if (pool.exists(txid)) { | if (pool.exists(txid)) { | ||||
return state.Invalid(false, REJECT_ALREADY_KNOWN, | return state.Invalid(false, REJECT_ALREADY_KNOWN, | ||||
"txn-already-in-mempool"); | "txn-already-in-mempool"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,349 Lines • Show Last 20 Lines |