mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge #8312: Fix mempool DoS vulnerability from malleated transactions
46c9620Test that unnecessary witnesses can't be used for mempool DoS (Suhas Daftuar)bb66a11Fix DoS vulnerability in mempool acceptance (Suhas Daftuar)
This commit is contained in:
10
src/main.cpp
10
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.
|
||||
|
||||
Reference in New Issue
Block a user