mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
common: allow configvars to be marked dynamic.
To test, we do min-capacity-sat which is simple. We also update the listconfigs man page which contained some obsolete information. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -143,6 +143,8 @@ static void json_add_config(struct lightningd *ld,
|
||||
json_add_bool(response, "set", cv != NULL);
|
||||
json_add_source(response, "source", cv);
|
||||
json_add_config_plugin(response, ld->plugins, "plugin", ot);
|
||||
if (ot->type & OPT_DYNAMIC)
|
||||
json_add_bool(response, "dynamic", true);
|
||||
json_object_end(response);
|
||||
return;
|
||||
}
|
||||
@@ -167,6 +169,8 @@ static void json_add_config(struct lightningd *ld,
|
||||
}
|
||||
json_array_end(response);
|
||||
json_add_config_plugin(response, ld->plugins, "plugin", ot);
|
||||
if (ot->type & OPT_DYNAMIC)
|
||||
json_add_bool(response, "dynamic", true);
|
||||
json_object_end(response);
|
||||
return;
|
||||
}
|
||||
@@ -180,6 +184,8 @@ static void json_add_config(struct lightningd *ld,
|
||||
json_add_configval(response, configval_fieldname(ot), ot, val);
|
||||
json_add_source(response, "source", cv);
|
||||
json_add_config_plugin(response, ld->plugins, "plugin", ot);
|
||||
if (ot->type & OPT_DYNAMIC)
|
||||
json_add_bool(response, "dynamic", true);
|
||||
json_object_end(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -1352,7 +1352,7 @@ static void register_opts(struct lightningd *ld)
|
||||
opt_set_msat,
|
||||
opt_show_msat, &ld->config.max_dust_htlc_exposure_msat,
|
||||
"Max HTLC amount that can be trimmed");
|
||||
clnopt_witharg("--min-capacity-sat", OPT_SHOWINT, opt_set_u64, opt_show_u64,
|
||||
clnopt_witharg("--min-capacity-sat", OPT_SHOWINT|OPT_DYNAMIC, opt_set_u64, opt_show_u64,
|
||||
&ld->config.min_capacity_sat,
|
||||
"Minimum capacity in satoshis for accepting channels");
|
||||
clnopt_witharg("--addr", OPT_MULTI, opt_add_addr, NULL,
|
||||
|
||||
Reference in New Issue
Block a user