mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge pull request #2949 from gmaxwell/fewer_fee_footguns
[raw] reject insanely high fees by default in sendrawtransaction
This commit is contained in:
@@ -787,7 +787,7 @@ void CTxMemPool::pruneSpent(const uint256 &hashTx, CCoins &coins)
|
||||
}
|
||||
|
||||
bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fLimitFree,
|
||||
bool* pfMissingInputs)
|
||||
bool* pfMissingInputs, bool fRejectInsaneFee)
|
||||
{
|
||||
if (pfMissingInputs)
|
||||
*pfMissingInputs = false;
|
||||
@@ -921,6 +921,11 @@ bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fL
|
||||
dFreeCount += nSize;
|
||||
}
|
||||
|
||||
if (fRejectInsaneFee && nFees > CTransaction::nMinRelayTxFee * 10000)
|
||||
return error("CTxMemPool::accept() : insane fees %s, %"PRI64d" > %"PRI64d,
|
||||
hash.ToString().c_str(),
|
||||
nFees, CTransaction::nMinRelayTxFee * 10000);
|
||||
|
||||
// Check against previous transactions
|
||||
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
|
||||
if (!CheckInputs(tx, state, view, true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC))
|
||||
|
||||
Reference in New Issue
Block a user