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

Function json_add_plugin_opt

lightningd/plugin.c:1832–1849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1830}
1831
1832static void json_add_plugin_opt(struct json_stream *stream,
1833 const char *name,
1834 const char *type,
1835 const struct plugin_opt_value *value)
1836{
1837 if (streq(type, "flag")) {
1838 /* We don't include 'flag' types if they're not
1839 * flagged on */
1840 if (value->as_bool)
1841 json_add_bool(stream, name, value->as_bool);
1842 } else if (streq(type, "bool")) {
1843 json_add_bool(stream, name, value->as_bool);
1844 } else if (streq(type, "string")) {
1845 json_add_string(stream, name, value->as_str);
1846 } else if (streq(type, "int")) {
1847 json_add_s64(stream, name, value->as_int);
1848 }
1849}
1850
1851void
1852plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req)

Callers 2

Calls 3

json_add_s64Function · 0.85
json_add_boolFunction · 0.50
json_add_stringFunction · 0.50

Tested by

no test coverage detected