mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
plugins/pay: get max-locktime-blocks at init for setting default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
f85d7d03b8
commit
6974c58b47
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
/* Public key of this node. */
|
/* Public key of this node. */
|
||||||
static struct pubkey my_id;
|
static struct pubkey my_id;
|
||||||
|
static unsigned int maxdelay_default;
|
||||||
|
|
||||||
struct pay_attempt {
|
struct pay_attempt {
|
||||||
const char *route;
|
const char *route;
|
||||||
@@ -282,8 +283,7 @@ static struct command_result *handle_pay(struct command *cmd,
|
|||||||
p_opt_def("maxfeepercent", param_percent, &maxfeepercent, 0.5),
|
p_opt_def("maxfeepercent", param_percent, &maxfeepercent, 0.5),
|
||||||
p_opt_def("retry_for", param_number, &retryfor, 60),
|
p_opt_def("retry_for", param_number, &retryfor, 60),
|
||||||
p_opt_def("maxdelay", param_number, &maxdelay,
|
p_opt_def("maxdelay", param_number, &maxdelay,
|
||||||
/* FIXME! */
|
maxdelay_default),
|
||||||
14 * 24 * 6),
|
|
||||||
p_opt_def("exemptfee", param_u64, &exemptfee, 5000),
|
p_opt_def("exemptfee", param_u64, &exemptfee, 5000),
|
||||||
NULL))
|
NULL))
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -335,6 +335,11 @@ static void init(struct plugin_conn *rpc)
|
|||||||
field = rpc_delve(tmpctx, "getinfo", "", rpc, ".id");
|
field = rpc_delve(tmpctx, "getinfo", "", rpc, ".id");
|
||||||
if (!pubkey_from_hexstr(field, strlen(field), &my_id))
|
if (!pubkey_from_hexstr(field, strlen(field), &my_id))
|
||||||
plugin_err("getinfo didn't contain valid id: '%s'", field);
|
plugin_err("getinfo didn't contain valid id: '%s'", field);
|
||||||
|
|
||||||
|
field = rpc_delve(tmpctx, "listconfigs",
|
||||||
|
"'config': 'max-locktime-blocks'",
|
||||||
|
rpc, ".max-locktime-blocks");
|
||||||
|
maxdelay_default = atoi(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct plugin_command commands[] = { {
|
static const struct plugin_command commands[] = { {
|
||||||
|
|||||||
Reference in New Issue
Block a user