| 595 | } |
| 596 | |
| 597 | static 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 | |
| 621 | bool rpc_scan_datastore_str(struct plugin *plugin, |
| 622 | const char *path, |
no test coverage detected