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

Function json_helloworld

tests/plugins/test_libplugin.c:14–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12static bool dont_shutdown = false;
13
14static struct command_result *json_helloworld(struct command *cmd,
15 const char *buf,
16 const jsmntok_t *params)
17{
18 const char *name;
19
20 if (!param(cmd, buf, params,
21 p_opt("name", param_string, &name),
22 NULL))
23 return command_param_failed();
24
25 plugin_notify_message(cmd, LOG_INFORM, "Notification from %s", "json_helloworld");
26 if (!name)
27 name = name_option ? name_option : tal_strdup(tmpctx, "world");
28
29 return command_success(cmd, json_out_obj(cmd, "hello", name));
30}
31
32static struct command_result *
33json_peer_connected(struct command *cmd,

Callers

nothing calls this directly

Calls 5

plugin_notify_messageFunction · 0.85
json_out_objFunction · 0.85
paramFunction · 0.50
command_param_failedFunction · 0.50
command_successFunction · 0.50

Tested by

no test coverage detected