mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Invoke CheckSpecialTx after all normal TX checks have passed (#2673)
Otherwise duplicate-keys checks for deterministic masternodes triggers for duplicate/identical transactions.
This commit is contained in:
parent
592210dafc
commit
0d8cc0761c
@ -656,9 +656,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
||||
return state.DoS(100, false, REJECT_INVALID, "qc-not-allowed");
|
||||
}
|
||||
|
||||
if (!CheckSpecialTx(tx, chainActive.Tip(), state))
|
||||
return false;
|
||||
|
||||
// Coinbase is only valid in a block, not as a loose transaction
|
||||
if (tx.IsCoinBase())
|
||||
return state.DoS(100, false, REJECT_INVALID, "coinbase");
|
||||
@ -866,6 +863,12 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
||||
return state.DoS(0, false, REJECT_NONSTANDARD, "too-long-mempool-chain", false, errString);
|
||||
}
|
||||
|
||||
// check special TXs after all the other checks. If we'd do this before the other checks, we might end up
|
||||
// DoS scoring a node for non-critical errors, e.g. duplicate keys because a TX is received that was already
|
||||
// mined
|
||||
if (!CheckSpecialTx(tx, chainActive.Tip(), state))
|
||||
return false;
|
||||
|
||||
// If we aren't going to actually accept it but just were verifying it, we are fine already
|
||||
if(fDryRun) return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user