From 5478183e7e241aff35117f7f4f76d955d9465996 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 6 Feb 2019 17:54:10 +0100 Subject: [PATCH] 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. --- src/validation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 3cfd4211cc276..7aa92ffc19945 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -667,10 +667,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C if (fRequireStandard && !IsStandardTx(tx, reason)) return state.DoS(0, false, REJECT_NONSTANDARD, reason); - if (pool.existsProviderTxConflict(tx)) { - return state.DoS(0, false, REJECT_DUPLICATE, "protx-dup"); - } - // 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 // be mined yet. @@ -871,6 +867,10 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C if (!CheckSpecialTx(tx, chainActive.Tip(), state)) return false; + if (pool.existsProviderTxConflict(tx)) { + return state.DoS(0, false, REJECT_DUPLICATE, "protx-dup"); + } + // If we aren't going to actually accept it but just were verifying it, we are fine already if(fDryRun) return true;