@@ -201,22 +201,20 @@ static std::string LabelFromValue(const UniValue& value)
201
201
* @param[in] wallet Wallet reference
202
202
* @param[in,out] cc Coin control to be updated
203
203
* @param[in] conf_target UniValue integer; confirmation target in blocks, values between 1 and 1008 are valid per policy/fees.h;
204
- * if a fee_rate is present, 0 is allowed here as a no-op positional placeholder
205
204
* @param[in] estimate_mode UniValue string; fee estimation mode, valid values are "unset", "economical" or "conservative";
206
- * if a fee_rate is present, "" is allowed here as a no-op positional placeholder
207
205
* @param[in] fee_rate UniValue real; fee rate in sat/vB;
208
- * if a fee_rate is present, both conf_target and estimate_mode must either be null, or no-op
206
+ * if present, both conf_target and estimate_mode must either be null, or "unset"
209
207
* @param[in] override_min_fee bool; whether to set fOverrideFeeRate to true to disable minimum fee rate checks and instead
210
208
* verify only that fee_rate is greater than 0
211
209
* @throws a JSONRPCError if conf_target, estimate_mode, or fee_rate contain invalid values or are in conflict
212
210
*/
213
211
static void SetFeeEstimateMode (const CWallet& wallet, CCoinControl& cc, const UniValue& conf_target, const UniValue& estimate_mode, const UniValue& fee_rate, bool override_min_fee)
214
212
{
215
213
if (!fee_rate.isNull ()) {
216
- if (!conf_target.isNull () && conf_target. get_int () > 0 ) {
214
+ if (!conf_target.isNull ()) {
217
215
throw JSONRPCError (RPC_INVALID_PARAMETER, " Cannot specify both conf_target and fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate." );
218
216
}
219
- if (!estimate_mode.isNull () && ! estimate_mode.get_str (). empty () ) {
217
+ if (!estimate_mode.isNull () && estimate_mode.get_str () != " unset " ) {
220
218
throw JSONRPCError (RPC_INVALID_PARAMETER, " Cannot specify both estimate_mode and fee_rate" );
221
219
}
222
220
CFeeRate fee_rate_in_sat_vb{CFeeRate (AmountFromValue (fee_rate), COIN)};
@@ -473,8 +471,8 @@ static RPCHelpMan sendtoaddress()
473
471
+ HelpExampleCli (" sendtoaddress" , " \" " + EXAMPLE_ADDRESS[0 ] + " \" 0.1" ) +
474
472
" \n Send 0.1 BTC with a confirmation target of 6 blocks in economical fee estimate mode using positional arguments\n "
475
473
+ HelpExampleCli (" sendtoaddress" , " \" " + EXAMPLE_ADDRESS[0 ] + " \" 0.1 \" donation\" \" sean's outpost\" false true 6 economical" ) +
476
- " \n Send 0.1 BTC with a fee rate of 1 " + CURRENCY_ATOM + " /vB, subtract fee from amount, BIP125-replaceable, using positional arguments\n "
477
- + HelpExampleCli (" sendtoaddress" , " \" " + EXAMPLE_ADDRESS[0 ] + " \" 0.1 \" drinks\" \" room77\" true true 0 \"\" 1" ) +
474
+ " \n Send 0.1 BTC with a fee rate of 1.1 " + CURRENCY_ATOM + " /vB, subtract fee from amount, BIP125-replaceable, using positional arguments\n "
475
+ + HelpExampleCli (" sendtoaddress" , " \" " + EXAMPLE_ADDRESS[0 ] + " \" 0.1 \" drinks\" \" room77\" true true null \" unset \" null 1. 1" ) +
478
476
" \n Send 0.2 BTC with a confirmation target of 6 blocks in economical fee estimate mode using named arguments\n "
479
477
+ HelpExampleCli (" -named sendtoaddress" , " address=\" " + EXAMPLE_ADDRESS[0 ] + " \" amount=0.2 conf_target=6 estimate_mode=\" economical\" " ) +
480
478
" \n Send 0.5 BTC with a fee rate of 25 " + CURRENCY_ATOM + " /vB using named arguments\n "
@@ -4081,10 +4079,10 @@ static RPCHelpMan send()
4081
4079
RPCExamples{" "
4082
4080
" \n Send 0.1 BTC with a confirmation target of 6 blocks in economical fee estimate mode\n "
4083
4081
+ HelpExampleCli (" send" , " '{\" " + EXAMPLE_ADDRESS[0 ] + " \" : 0.1}' 6 economical\n " ) +
4084
- " Send 0.2 BTC with a fee rate of 1 " + CURRENCY_ATOM + " /vB using positional arguments\n "
4085
- + HelpExampleCli (" send" , " '{\" " + EXAMPLE_ADDRESS[0 ] + " \" : 0.2}' 0 \"\" 1\n " ) +
4082
+ " Send 0.2 BTC with a fee rate of 1.1 " + CURRENCY_ATOM + " /vB using positional arguments\n "
4083
+ + HelpExampleCli (" send" , " '{\" " + EXAMPLE_ADDRESS[0 ] + " \" : 0.2}' null \" unset \" 1. 1\n " ) +
4086
4084
" Send 0.2 BTC with a fee rate of 1 " + CURRENCY_ATOM + " /vB using the options argument\n "
4087
- + HelpExampleCli (" send" , " '{\" " + EXAMPLE_ADDRESS[0 ] + " \" : 0.2}' '{\" fee_rate\" : 1}'\n " ) +
4085
+ + HelpExampleCli (" send" , " '{\" " + EXAMPLE_ADDRESS[0 ] + " \" : 0.2}' null \" unset \" null '{\" fee_rate\" : 1}'\n " ) +
4088
4086
" Send 0.3 BTC with a fee rate of 25 " + CURRENCY_ATOM + " /vB using named arguments\n "
4089
4087
+ HelpExampleCli (" -named send" , " outputs='{\" " + EXAMPLE_ADDRESS[0 ] + " \" : 0.3}' fee_rate=25\n " ) +
4090
4088
" Create a transaction that should confirm the next block, with a specific input, and return result without adding to wallet or broadcasting to the network\n "
0 commit comments