| 2165 | } |
| 2166 | |
| 2167 | void |
| 2168 | plugin_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 | |
| 2197 | static void |
| 2198 | plugin_config(struct plugin *plugin) |
no test coverage detected