aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-07-14 08:20:38 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-07-14 08:21:13 +0200
commitca40ef6029c1b4f2984e767b6c335dca6d637388 (patch)
tree34c1c86517707c6ad5496d36ce7ed4bc03ef2f4c /src/main.cpp
parent4324bd237c3147fc153ba5046c211f03e8ac956a (diff)
parent46c9620f11acfd2b528959d6cbab324105c3adef (diff)
downloadbitcoin-ca40ef6029c1b4f2984e767b6c335dca6d637388.tar.xz
Merge #8312: Fix mempool DoS vulnerability from malleated transactions
46c9620 Test that unnecessary witnesses can't be used for mempool DoS (Suhas Daftuar) bb66a11 Fix DoS vulnerability in mempool acceptance (Suhas Daftuar)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4bbda4cafe..62f1cd1517 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1132,11 +1132,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
if (tx.IsCoinBase())
return state.DoS(100, false, REJECT_INVALID, "coinbase");
- // Rather not work on nonstandard transactions (unless -testnet/-regtest)
- string reason;
- if (fRequireStandard && !IsStandardTx(tx, reason))
- return state.DoS(0, false, REJECT_NONSTANDARD, reason);
-
// Don't relay version 2 transactions until CSV is active, and we can be
// sure that such transactions will be mined (unless we're on
// -testnet/-regtest).
@@ -1150,6 +1145,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
return state.DoS(0, false, REJECT_NONSTANDARD, "no-witness-yet", true);
}
+ // Rather not work on nonstandard transactions (unless -testnet/-regtest)
+ string reason;
+ if (fRequireStandard && !IsStandardTx(tx, reason))
+ return state.DoS(0, false, REJECT_NONSTANDARD, reason);
+
// 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.