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

Function read_one_json_sync

plugins/libplugin.c:722–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722static const char *read_one_json_sync(struct plugin *p, const jsmntok_t **toks)
723{
724 for (;;) {
725 const char *buf, *error;
726
727 error = jsonrpc_io_parse(tmpctx, p->sync_io, toks, &buf);
728 if (error)
729 plugin_err(p, "Parsing sync lightningd: %s", error);
730 if (*toks)
731 return buf;
732
733 /* lightningd goes away, we go away. */
734 if (!jsonrpc_sync_read(p->sync_io, p->sync_fd)) {
735 if (errno == 0)
736 exit(0);
737 else
738 plugin_err(p, "Reading sync lightningd: %s",
739 strerror(errno));
740 }
741 }
742}
743
744/* Reads rpc reply and returns result tokens */
745static 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