Skip to content

Commit 5478183

Browse files
authored
Call existsProviderTxConflict after CheckSpecialTx (#2690)
Otherwise we might end up passing and invalid proTx into it, causing assertions to fail and thus crash the process.
1 parent 7e42572 commit 5478183

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/validation.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
667667
if (fRequireStandard && !IsStandardTx(tx, reason))
668668
return state.DoS(0, false, REJECT_NONSTANDARD, reason);
669669

670-
if (pool.existsProviderTxConflict(tx)) {
671-
return state.DoS(0, false, REJECT_DUPLICATE, "protx-dup");
672-
}
673-
674670
// Only accept nLockTime-using transactions that can be mined in the next
675671
// block; we don't want our mempool filled up with transactions that can't
676672
// be mined yet.
@@ -871,6 +867,10 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
871867
if (!CheckSpecialTx(tx, chainActive.Tip(), state))
872868
return false;
873869

870+
if (pool.existsProviderTxConflict(tx)) {
871+
return state.DoS(0, false, REJECT_DUPLICATE, "protx-dup");
872+
}
873+
874874
// If we aren't going to actually accept it but just were verifying it, we are fine already
875875
if(fDryRun) return true;
876876

0 commit comments

Comments
 (0)