From 9d14e689c86a395c11a530767db4ddf895446ba8 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Wed, 28 Aug 2013 15:41:46 -0700 Subject: [raw] reject insanely high fees by default in sendrawtransaction There have been several incidents where mainnet experimentation with raw transactions resulted in insane fees. This is hard to prevent in the raw transaction api because the inputs may not be known. Since sending doesn't work if the inputs aren't known, we can catch it there. This rejects fees > than 10000 * nMinRelayTxFee or 1 BTC with the defaults and can be overridden with a bool at the rpc. --- src/bitcoinrpc.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/bitcoinrpc.cpp') diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index d22809ce6..95c068034 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1193,6 +1193,7 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector 1) ConvertTo(params[1]); if (strMethod == "signrawtransaction" && n > 1) ConvertTo(params[1], true); if (strMethod == "signrawtransaction" && n > 2) ConvertTo(params[2], true); + if (strMethod == "sendrawtransaction" && n > 1) ConvertTo(params[1], true); if (strMethod == "gettxout" && n > 1) ConvertTo(params[1]); if (strMethod == "gettxout" && n > 2) ConvertTo(params[2]); if (strMethod == "lockunspent" && n > 0) ConvertTo(params[0]); -- cgit v1.2.3