Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 501 Lines • ▼ Show 20 Lines | if (!ContextualCheckTransactionForCurrentBlock( | ||||
// ban score of peer for transaction that could be valid in the future. | // ban score of peer for transaction that could be valid in the future. | ||||
return state.DoS( | return state.DoS( | ||||
0, false, REJECT_NONSTANDARD, ctxState.GetRejectReason(), | 0, false, REJECT_NONSTANDARD, ctxState.GetRejectReason(), | ||||
ctxState.CorruptionPossible(), ctxState.GetDebugMessage()); | 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_DUPLICATE, "txn-already-in-mempool"); | ||||
"txn-already-in-mempool"); | |||||
} | } | ||||
// Check for conflicts with in-memory transactions | // Check for conflicts with in-memory transactions | ||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
auto itConflicting = pool.mapNextTx.find(txin.prevout); | auto itConflicting = pool.mapNextTx.find(txin.prevout); | ||||
if (itConflicting != pool.mapNextTx.end()) { | if (itConflicting != pool.mapNextTx.end()) { | ||||
// Disable replacement feature for good | // Disable replacement feature for good | ||||
return state.Invalid(false, REJECT_CONFLICT, | return state.Invalid(false, REJECT_DUPLICATE, | ||||
"txn-mempool-conflict"); | "txn-mempool-conflict"); | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
CCoinsView dummy; | CCoinsView dummy; | ||||
CCoinsViewCache view(&dummy); | CCoinsViewCache view(&dummy); | ||||
▲ Show 20 Lines • Show All 5,199 Lines • Show Last 20 Lines |