mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
libplugin: replace rpc_delve with rpc_scan.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
b61da8c5a9
commit
09b18bf64f
@@ -1890,18 +1890,13 @@ static struct command_result *json_listpays(struct command *cmd,
|
||||
static void init(struct plugin *p,
|
||||
const char *buf UNUSED, const jsmntok_t *config UNUSED)
|
||||
{
|
||||
const char *field;
|
||||
rpc_scan(p, "getinfo", take(json_out_obj(NULL, NULL, NULL)),
|
||||
"{id:%}", JSON_SCAN(json_to_node_id, &my_id));
|
||||
|
||||
field = rpc_delve(tmpctx, p, "getinfo",
|
||||
take(json_out_obj(NULL, NULL, NULL)), ".id");
|
||||
if (!node_id_from_hexstr(field, strlen(field), &my_id))
|
||||
plugin_err(p, "getinfo didn't contain valid id: '%s'", field);
|
||||
|
||||
field = rpc_delve(tmpctx, p, "listconfigs",
|
||||
take(json_out_obj(NULL,
|
||||
"config", "max-locktime-blocks")),
|
||||
".max-locktime-blocks");
|
||||
maxdelay_default = atoi(field);
|
||||
rpc_scan(p, "listconfigs",
|
||||
take(json_out_obj(NULL, "config", "max-locktime-blocks")),
|
||||
"{max-locktime-blocks:%}",
|
||||
JSON_SCAN(json_to_number, &maxdelay_default));
|
||||
}
|
||||
|
||||
struct payment_modifier *paymod_mods[] = {
|
||||
|
||||
Reference in New Issue
Block a user