| 285 | } |
| 286 | |
| 287 | static const char *init(struct command *init_cmd, |
| 288 | const char *buf UNUSED, |
| 289 | const jsmntok_t *config UNUSED) |
| 290 | { |
| 291 | plugin = init_cmd->plugin; |
| 292 | rpc_scan(init_cmd, "listconfigs", |
| 293 | take(json_out_obj(NULL, NULL, NULL)), |
| 294 | "{configs:{" |
| 295 | "conf?:{value_str:%}," |
| 296 | "lightning-dir:{value_str:%}," |
| 297 | "network:{value_str:%}" |
| 298 | "}}", |
| 299 | JSON_SCAN_TAL(plugin, json_strdup, &lconfig.config), |
| 300 | JSON_SCAN_TAL(plugin, json_strdup, &lconfig.lightningdir), |
| 301 | JSON_SCAN_TAL(plugin, json_strdup, &lconfig.network)); |
| 302 | /* These lightning config parameters need to stick around for each |
| 303 | * reckless call. */ |
| 304 | if (lconfig.config) |
| 305 | notleak(lconfig.config); |
| 306 | notleak(lconfig.lightningdir); |
| 307 | notleak(lconfig.network); |
| 308 | plugin_log(plugin, LOG_DBG, "plugin initialized!"); |
| 309 | plugin_log(plugin, LOG_DBG, "lightning-dir: %s", lconfig.lightningdir); |
| 310 | return NULL; |
| 311 | } |
| 312 | |
| 313 | static const struct plugin_command commands[] = { |
| 314 | { |
nothing calls this directly
no test coverage detected