Skip to content

Commit

Permalink
Call existsProviderTxConflict after CheckSpecialTx (#2690)
Browse files Browse the repository at this point in the history
Otherwise we might end up passing and invalid proTx into it, causing
assertions to fail and thus crash the process.
  • Loading branch information
codablock committed Feb 6, 2019
1 parent 7e42572 commit 5478183
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 5478183

Please sign in to comment.