-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[raw] reject insanely high fees by default in sendrawtransaction #2949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
|
ACK |
|
Instead of a bool, how about an amount of fees? If provided and the transaction fees don't match the value, fail. (This can be in addition to the default rejection, for backward compatibility) |
|
@luke-jr Good idea, although I won't make it a <= test, not a == test. Actually, no, I'm going to take that back: app developers are just going to call sendrawtransaction with their nFees, which is likely to be calculated wrong anyway... So stick with the hard sanity limit. |
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/9d14e689c86a395c11a530767db4ddf895446ba8 for binaries and test log. |
|
Sanity testing on fees would certainly have helped me. I've been using sendrawtransaction in a variety of circumstances for 5 months now. I was pretty confident with the raw transaction tools, and (until today) had created over 200 transactions without any issues. Then while creating a raw transaction today, I accidentally included vout=0 when I intended to include vout=1 in the input. The result was accidentally paying a fee of 3.78843458 BTC. I had thought that I had calculated a fee of 0.0001 BTC (if I had used the intended vout). Any of the following would have prevented the issue: Issue reported at bitcointalk.org here: https://bitcointalk.org/index.php?topic=295101.0;topicseen Transaction example can be seen here: https://blockchain.info/tx-index/89611419 |
|
Any reason to merge this? |
[raw] reject insanely high fees by default in sendrawtransaction
* RPC - Update gobject description to match other multi-command RPCs * RPC - Update masternodelist to avoid returning dupe RPC name from help * RPC - Make spacing consistent in gobject/masternode help
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.