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

Function plugin_send_getmanifest

lightningd/plugin.c:1969–2003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1967
1968}
1969const char *plugin_send_getmanifest(struct plugin *p, const char *cmd_id)
1970{
1971 char **cmd;
1972 int stdinfd, stdoutfd;
1973 struct jsonrpc_request *req;
1974
1975 cmd = tal_arr(tmpctx, char *, 1);
1976 cmd[0] = p->cmd;
1977 if (debugging(p))
1978 tal_arr_expand(&cmd, "--dev-debug-self");
1979 if (p->plugins->ld->developer)
1980 tal_arr_expand(&cmd, "--developer");
1981 tal_arr_expand(&cmd, NULL);
1982 p->pid = pipecmdarr(&stdinfd, &stdoutfd, &pipecmd_preserve, cmd);
1983 if (p->pid == -1)
1984 return tal_fmt(p, "opening pipe: %s", strerror(errno));
1985
1986 log_debug(p->plugins->log, "started(%u) %s", p->pid, p->cmd);
1987 p->json_in = jsonrpc_io_new(p);
1988
1989 /* Create two connections, one read-only on top of p->stdout, and one
1990 * write-only on p->stdin */
1991 io_new_conn(p, stdoutfd, plugin_stdout_conn_init, p);
1992 io_new_conn(p, stdinfd, plugin_stdin_conn_init, p);
1993 req = jsonrpc_request_start(p, "getmanifest", cmd_id,
1994 p->log, NULL, plugin_manifest_cb, p);
1995 json_add_bool(req->stream, "allow-deprecated-apis",
1996 p->plugins->ld->deprecated_ok);
1997 jsonrpc_request_end(req);
1998 plugin_request_send(p, req);
1999 p->plugin_state = AWAITING_GETMANIFEST_RESPONSE;
2000
2001 plugin_set_timeout(p);
2002 return NULL;
2003}
2004
2005bool plugins_send_getmanifest(struct plugins *plugins, const char *cmd_id)
2006{

Callers 2

plugins_send_getmanifestFunction · 0.85
plugin_dynamic_startFunction · 0.85

Calls 7

pipecmdarrFunction · 0.85
jsonrpc_io_newFunction · 0.85
json_add_boolFunction · 0.85
plugin_set_timeoutFunction · 0.85
debuggingFunction · 0.70
jsonrpc_request_endFunction · 0.70
plugin_request_sendFunction · 0.70

Tested by

no test coverage detected