| 2177 | } |
| 2178 | |
| 2179 | void |
| 2180 | plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req) |
| 2181 | { |
| 2182 | struct lightningd *ld = plugin->plugins->ld; |
| 2183 | |
| 2184 | /* Add .params.options */ |
| 2185 | json_add_plugin_options(req->stream, "options", plugin, true); |
| 2186 | /* Add .params.configuration */ |
| 2187 | json_object_start(req->stream, "configuration"); |
| 2188 | json_add_string(req->stream, "lightning-dir", ld->config_netdir); |
| 2189 | json_add_string(req->stream, "rpc-file", ld->rpc_filename); |
| 2190 | json_add_bool(req->stream, "startup", plugin->plugins->startup); |
| 2191 | json_add_string(req->stream, "network", chainparams->network_name); |
| 2192 | if (ld->proxyaddr) { |
| 2193 | json_add_address(req->stream, "proxy", ld->proxyaddr); |
| 2194 | json_add_bool(req->stream, "torv3-enabled", true); |
| 2195 | json_add_bool(req->stream, "always_use_proxy", ld->always_use_proxy); |
| 2196 | } |
| 2197 | json_object_start(req->stream, "feature_set"); |
| 2198 | for (enum feature_place fp = 0; fp < NUM_FEATURE_PLACE; fp++) { |
| 2199 | if (feature_place_names[fp]) { |
| 2200 | json_add_hex_talarr(req->stream, |
| 2201 | feature_place_names[fp], |
| 2202 | ld->our_features->bits[fp]); |
| 2203 | } |
| 2204 | } |
| 2205 | json_object_end(req->stream); |
| 2206 | json_object_end(req->stream); |
| 2207 | } |
| 2208 | |
| 2209 | static void |
| 2210 | plugin_config(struct plugin *plugin) |
no test coverage detected