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

Function plugin_populate_init_request

lightningd/plugin.c:2167–2195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2165}
2166
2167void
2168plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req)
2169{
2170 struct lightningd *ld = plugin->plugins->ld;
2171
2172 /* Add .params.options */
2173 json_add_plugin_options(req->stream, "options", plugin, true);
2174 /* Add .params.configuration */
2175 json_object_start(req->stream, "configuration");
2176 json_add_string(req->stream, "lightning-dir", ld->config_netdir);
2177 json_add_string(req->stream, "rpc-file", ld->rpc_filename);
2178 json_add_bool(req->stream, "startup", plugin->plugins->startup);
2179 json_add_string(req->stream, "network", chainparams->network_name);
2180 if (ld->proxyaddr) {
2181 json_add_address(req->stream, "proxy", ld->proxyaddr);
2182 json_add_bool(req->stream, "torv3-enabled", true);
2183 json_add_bool(req->stream, "always_use_proxy", ld->always_use_proxy);
2184 }
2185 json_object_start(req->stream, "feature_set");
2186 for (enum feature_place fp = 0; fp < NUM_FEATURE_PLACE; fp++) {
2187 if (feature_place_names[fp]) {
2188 json_add_hex_talarr(req->stream,
2189 feature_place_names[fp],
2190 ld->our_features->bits[fp]);
2191 }
2192 }
2193 json_object_end(req->stream);
2194 json_object_end(req->stream);
2195}
2196
2197static void
2198plugin_config(struct plugin *plugin)

Callers 2

plugin_configFunction · 0.85
config_pluginFunction · 0.85

Calls 7

json_add_plugin_optionsFunction · 0.85
json_object_startFunction · 0.85
json_add_boolFunction · 0.85
json_add_addressFunction · 0.85
json_add_hex_talarrFunction · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected