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

Function read_one_json_sync

plugins/libplugin.c:712–732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712static const char *read_one_json_sync(struct plugin *p, const jsmntok_t **toks)
713{
714 for (;;) {
715 const char *buf, *error;
716
717 error = jsonrpc_io_parse(tmpctx, p->sync_io, toks, &buf);
718 if (error)
719 plugin_err(p, "Parsing sync lightningd: %s", error);
720 if (*toks)
721 return buf;
722
723 /* lightningd goes away, we go away. */
724 if (!jsonrpc_sync_read(p->sync_io, p->sync_fd)) {
725 if (errno == 0)
726 exit(0);
727 else
728 plugin_err(p, "Reading sync lightningd: %s",
729 strerror(errno));
730 }
731 }
732}
733
734/* Reads rpc reply and returns result tokens */
735static const jsmntok_t *read_sync_rpc_reply(const tal_t *ctx,

Callers 1

read_sync_rpc_replyFunction · 0.85

Calls 3

jsonrpc_io_parseFunction · 0.85
jsonrpc_sync_readFunction · 0.85
plugin_errFunction · 0.70

Tested by

no test coverage detected