settxfee
RPC, the value is silently ignored if it is less than either than minrelaytxfee or the wallet’s mintxfee. This adds an error response if that’s going to happen, but still allows “settxfee 0” to deliberately default to the minimum value.
Add checks for settxfee reasonableness #13988
pull ajtowns wants to merge 2 commits into bitcoin:master from ajtowns:201808-settxfee-checks changing 2 files +12 −2-
ajtowns commented at 2:52 am on August 16, 2018: memberWhen using the
-
Add checks for settxfee reasonableness 48618daf26
-
fanquake added the label Wallet on Aug 16, 2018
-
fanquake added the label RPC/REST/ZMQ on Aug 16, 2018
-
DrahtBot commented at 4:45 am on August 16, 2018: member
-
MarcoFalke commented at 10:58 am on August 16, 2018: memberutACK 48618daf262b84c2e2f7322b5ca14375d7d68b64
-
in src/wallet/rpcwallet.cpp:2990 in 48618daf26 outdated
2981@@ -2982,8 +2982,16 @@ static UniValue settxfee(const JSONRPCRequest& request) 2982 LOCK2(cs_main, pwallet->cs_wallet); 2983 2984 CAmount nAmount = AmountFromValue(request.params[0]); 2985+ CFeeRate tx_fee_rate(nAmount, 1000); 2986+ if (tx_fee_rate == 0) { 2987+ // automatic selection 2988+ } else if (tx_fee_rate < ::minRelayTxFee) { 2989+ throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("txfee cannot be less than min relay tx fee (%s)", ::minRelayTxFee.ToString())); 2990+ } else if (tx_fee_rate < pwallet->m_min_fee) {
promag commented at 0:44 am on August 20, 2018:How about check this first?promag commented at 0:45 am on August 20, 2018: memberConcept ACK, could add tests?test: Check RPC settxfee errors 317f2cb3f4laanwj merged this on Aug 22, 2018laanwj closed this on Aug 22, 2018
laanwj referenced this in commit 17d644901b on Aug 22, 2018deadalnix referenced this in commit 5262a13f03 on Jan 13, 20205tefan referenced this in commit c2076a025d on Jul 29, 2021UdjinM6 referenced this in commit 6218a94677 on Jul 29, 2021Munkybooty referenced this in commit 0627a06072 on Aug 3, 2021MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me