MCPcopy Create free account
hub / github.com/ElementsProject/lightning / rpc_scan_datastore

Function rpc_scan_datastore

plugins/libplugin.c:597–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597static bool rpc_scan_datastore(struct plugin *plugin,
598 const char *path,
599 const char *hex_or_string,
600 va_list ap)
601{
602 const char *guide;
603 struct json_out *params;
604 const char *err;
605
606 params = json_out_new(NULL);
607 json_out_start(params, NULL, '{');
608 json_add_keypath(params, "key", path);
609 json_out_end(params, '}');
610 json_out_finished(params);
611
612 guide = tal_fmt(tmpctx, "{datastore:[0:{%s:%%}]}", hex_or_string);
613 /* FIXME: Could be some other error, but that's probably a caller bug! */
614 err = rpc_scan_core(tmpctx, plugin, "listdatastore", take(params), guide, ap);
615 if (!err)
616 return true;
617 plugin_log(plugin, LOG_DBG, "listdatastore error %s: %s", path, err);
618 return false;
619}
620
621bool rpc_scan_datastore_str(struct plugin *plugin,
622 const char *path,

Callers 2

rpc_scan_datastore_strFunction · 0.85
rpc_scan_datastore_hexFunction · 0.85

Calls 7

json_out_newFunction · 0.85
json_out_startFunction · 0.85
json_add_keypathFunction · 0.85
json_out_endFunction · 0.85
json_out_finishedFunction · 0.85
rpc_scan_coreFunction · 0.85
plugin_logFunction · 0.70

Tested by

no test coverage detected