diff options
| author | Gavin Andresen <[email protected]> | 2013-09-22 16:44:35 -0700 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-09-22 16:44:35 -0700 |
| commit | ff4e3e63e776fb320b87d2506d911d5a7fa757a4 (patch) | |
| tree | 7664d173e547e9fc616ab26ea17d05c77b607dd8 /src/main.cpp | |
| parent | Merge pull request #2995 from Diapolo/GUI_message (diff) | |
| parent | [raw] reject insanely high fees by default in sendrawtransaction (diff) | |
| download | discoin-ff4e3e63e776fb320b87d2506d911d5a7fa757a4.tar.xz discoin-ff4e3e63e776fb320b87d2506d911d5a7fa757a4.zip | |
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.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 61d457eaf..5ee2deffc 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)) |