Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 3,345 Lines • ▼ Show 20 Lines | static bool ContextualCheckBlock(const Config &config, const CBlock &block, | ||||
// Check that all transactions are finalized | // Check that all transactions are finalized | ||||
const CTransaction *prevTx = nullptr; | const CTransaction *prevTx = nullptr; | ||||
for (const auto &ptx : block.vtx) { | for (const auto &ptx : block.vtx) { | ||||
const CTransaction &tx = *ptx; | const CTransaction &tx = *ptx; | ||||
if (fIsMagneticAnomalyEnabled) { | if (fIsMagneticAnomalyEnabled) { | ||||
if (prevTx && (tx.GetId() <= prevTx->GetId())) { | if (prevTx && (tx.GetId() <= prevTx->GetId())) { | ||||
if (tx.GetId() == prevTx->GetId()) { | if (tx.GetId() == prevTx->GetId()) { | ||||
return state.DoS(100, false, REJECT_INVALID, "tx-duplicate", | return state.DoS(100, false, REJECT_INVALID, | ||||
false, | "bad-txns-duplicate", false, | ||||
Fabien: bad-txns-duplicate is already raised on validation.cpp:3122, better change the error name to… | |||||
jasonbcoxAuthorUnsubmitted Not Done Inline ActionsThis doesn't look related to making the test green. Please focus on that first. jasonbcox: This doesn't look related to making the test green. Please focus on that first. | |||||
schancelUnsubmitted Not Done Inline ActionsThis *is* a change in the error behavior. It changes the external API. schancel: This *is* a change in the error behavior. It changes the external API. | |||||
strprintf("Duplicated transaction %s", | strprintf("Duplicated transaction %s", | ||||
tx.GetId().ToString())); | tx.GetId().ToString())); | ||||
} | } | ||||
return state.DoS( | return state.DoS( | ||||
100, false, REJECT_INVALID, "tx-ordering", false, | 100, false, REJECT_INVALID, "tx-ordering", false, | ||||
strprintf("Transaction order is invalid (%s < %s)", | strprintf("Transaction order is invalid (%s < %s)", | ||||
tx.GetId().ToString(), | tx.GetId().ToString(), | ||||
▲ Show 20 Lines • Show All 1,899 Lines • Show Last 20 Lines |
bad-txns-duplicate is already raised on validation.cpp:3122, better change the error name to avoid confusion. From my understanding, the 2 errors are slightly different.