Fixing my nits from #7967#ref-commit-8c1e49b:
The feeRate default is not "estimate" but it is not set at all. Also the unit is satoshis per KB.
Fixing my nits from #7967#ref-commit-8c1e49b:
The feeRate default is not "estimate" but it is not set at all. Also the unit is satoshis per KB.
Thanks!
utACK.
nit: default not set could be misinterpret.
I'm confused. What does "not set" mean? Can an average user guess what the resulting behaviour will be?
"not set" stands for "not setting" a specific feerate. IMO it's better if we say the default value is the estimated feerate.
Or also include something about txconfirmtarget (which fundrawtransaction uses for fee estimation).
With "default not set" I mean that the option is disabled/not considered/ignored. Better suggestions welcome.
Currently it says that the default will be the estimated fee rate, which is wrong. Also it may change in the future so you can't "hardcode" it.
Even better would be to add another option to fundrawtransaction to set the confirmation target for estimation. Then you can say that if feerate is not set, the set target is used for estimating it. If that target is not set, the default is used.
As I understand this, you'd be breaking compatibility (basically a weak version of #7633, so at least mention in the release notes would be required). Though, I consider new features out of scope for this pull request.
2457 | @@ -2458,13 +2458,13 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp) 2458 | " \"changePosition\" (numeric, optional, default random) The index of the change output\n" 2459 | " \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n" 2460 | " \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n" 2461 | - " \"feeRate\" (numeric, optional, default 0=estimate) Set a specific feerate (fee per KB)\n" 2462 | + " \"feeRate\" (numeric, optional, default not set) Set a specific feerate (satoshis per KB)\n"
Maybe (numeric, optional, no default)?
Pushed a commit which says "default not set: makes wallet determine the fee". Is this easier to understand?
2457 | @@ -2458,13 +2458,13 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp) 2458 | " \"changePosition\" (numeric, optional, default random) The index of the change output\n" 2459 | " \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n" 2460 | " \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n" 2461 | - " \"feeRate\" (numeric, optional, default 0=estimate) Set a specific feerate (fee per KB)\n" 2462 | + " \"feeRate\" (numeric, optional, default not set: makes wallet determine the fee) Set a specific feerate (satoshis per KB)\n"
Not this pull's fault, but I wonder why was it chosen to use satoshis ere instead of just BTC/kB (converted using the AmountFromValue function)? This is inconsistent with the rest of the API (e.g. settxfee).
Let's leave this for another pull.
I kinda agree with @laanwj. The feeRate option has not been deployed. We could still change it to BTC/kb to be consistent with the rest of the API.
See #8153
(Squashed commits)