aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-09-22 16:44:35 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-09-22 16:44:35 -0700
commitff4e3e63e776fb320b87d2506d911d5a7fa757a4 (patch)
tree7664d173e547e9fc616ab26ea17d05c77b607dd8 /src/main.cpp
parentc2f41872638aaa097c2d0aec943ae8deeea667ad (diff)
parent9d14e689c86a395c11a530767db4ddf895446ba8 (diff)
Merge pull request #2949 from gmaxwell/fewer_fee_footguns
[raw] reject insanely high fees by default in sendrawtransaction
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 61d457eafc..5ee2deffc6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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))