| 1503 | } |
| 1504 | |
| 1505 | static const char *init(struct command *init_cmd, const char *b, const jsmntok_t *t) |
| 1506 | { |
| 1507 | const char *err; |
| 1508 | struct amount_msat msat; |
| 1509 | |
| 1510 | list_head_init(&pending_opens); |
| 1511 | |
| 1512 | err = funder_check_policy(current_policy); |
| 1513 | if (err) |
| 1514 | plugin_err(init_cmd->plugin, "Invalid parameter combination: %s", err); |
| 1515 | |
| 1516 | if (current_policy->rates) |
| 1517 | tell_lightningd_lease_rates(init_cmd, current_policy->rates); |
| 1518 | |
| 1519 | rpc_scan(init_cmd, "listconfigs", |
| 1520 | take(json_out_obj(NULL, NULL, NULL)), |
| 1521 | "{configs:" |
| 1522 | "{min-emergency-msat:{value_msat:%}}}", |
| 1523 | JSON_SCAN(json_to_msat, &msat)); |
| 1524 | |
| 1525 | emergency_reserve = amount_msat_to_sat_round_down(msat); |
| 1526 | plugin_set_memleak_handler(init_cmd->plugin, memleak_mark); |
| 1527 | |
| 1528 | return NULL; |
| 1529 | } |
| 1530 | |
| 1531 | const struct plugin_hook hooks[] = { |
| 1532 | { |
nothing calls this directly
no test coverage detected