mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-18 22:54:25 +01:00
wallet: fundpsbt, utxopsbt reserve cannot be bool.
Changelog-Removed: JSON-RPC: `fundpsbt`/`utxopsbt` `reserve` must be a number, not bool (deprecated v0.11.0) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -434,29 +434,6 @@ static inline u32 minconf_to_maxheight(u32 minconf, struct lightningd *ld)
|
|||||||
return ld->topology->tip->height - minconf + 1;
|
return ld->topology->tip->height - minconf + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct command_result *param_reserve_num(struct command *cmd,
|
|
||||||
const char *name,
|
|
||||||
const char *buffer,
|
|
||||||
const jsmntok_t *tok,
|
|
||||||
unsigned int **num)
|
|
||||||
{
|
|
||||||
bool flag;
|
|
||||||
|
|
||||||
if (deprecated_apis) {
|
|
||||||
/* "reserve=true" means 6 hours */
|
|
||||||
if (json_to_bool(buffer, tok, &flag)) {
|
|
||||||
*num = tal(cmd, unsigned int);
|
|
||||||
if (flag)
|
|
||||||
**num = RESERVATION_DEFAULT;
|
|
||||||
else
|
|
||||||
**num = 0;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return param_number(cmd, name, buffer, tok, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct command_result *json_fundpsbt(struct command *cmd,
|
static struct command_result *json_fundpsbt(struct command *cmd,
|
||||||
const char *buffer,
|
const char *buffer,
|
||||||
const jsmntok_t *obj UNNEEDED,
|
const jsmntok_t *obj UNNEEDED,
|
||||||
@@ -474,7 +451,7 @@ static struct command_result *json_fundpsbt(struct command *cmd,
|
|||||||
p_req("feerate", param_feerate, &feerate_per_kw),
|
p_req("feerate", param_feerate, &feerate_per_kw),
|
||||||
p_req("startweight", param_number, &weight),
|
p_req("startweight", param_number, &weight),
|
||||||
p_opt_def("minconf", param_number, &minconf, 1),
|
p_opt_def("minconf", param_number, &minconf, 1),
|
||||||
p_opt_def("reserve", param_reserve_num, &reserve,
|
p_opt_def("reserve", param_number, &reserve,
|
||||||
RESERVATION_DEFAULT),
|
RESERVATION_DEFAULT),
|
||||||
p_opt("locktime", param_number, &locktime),
|
p_opt("locktime", param_number, &locktime),
|
||||||
p_opt_def("min_witness_weight", param_number,
|
p_opt_def("min_witness_weight", param_number,
|
||||||
@@ -655,7 +632,7 @@ static struct command_result *json_utxopsbt(struct command *cmd,
|
|||||||
p_req("feerate", param_feerate, &feerate_per_kw),
|
p_req("feerate", param_feerate, &feerate_per_kw),
|
||||||
p_req("startweight", param_number, &weight),
|
p_req("startweight", param_number, &weight),
|
||||||
p_req("utxos", param_txout, &utxos),
|
p_req("utxos", param_txout, &utxos),
|
||||||
p_opt_def("reserve", param_reserve_num, &reserve,
|
p_opt_def("reserve", param_number, &reserve,
|
||||||
RESERVATION_DEFAULT),
|
RESERVATION_DEFAULT),
|
||||||
p_opt_def("reservedok", param_bool, &reserved_ok, false),
|
p_opt_def("reservedok", param_bool, &reserved_ok, false),
|
||||||
p_opt("locktime", param_number, &locktime),
|
p_opt("locktime", param_number, &locktime),
|
||||||
|
|||||||
Reference in New Issue
Block a user