| 1543 | } |
| 1544 | |
| 1545 | static const char *init(struct command *init_cmd, const char *b, const jsmntok_t *t) |
| 1546 | { |
| 1547 | const char *err; |
| 1548 | struct amount_msat msat; |
| 1549 | |
| 1550 | list_head_init(&pending_opens); |
| 1551 | list_head_init(&funding_queue); |
| 1552 | |
| 1553 | err = funder_check_policy(current_policy); |
| 1554 | if (err) |
| 1555 | plugin_err(init_cmd->plugin, "Invalid parameter combination: %s", err); |
| 1556 | |
| 1557 | if (current_policy->rates) |
| 1558 | tell_lightningd_lease_rates(init_cmd, current_policy->rates); |
| 1559 | |
| 1560 | rpc_scan(init_cmd, "listconfigs", |
| 1561 | take(json_out_obj(NULL, NULL, NULL)), |
| 1562 | "{configs:" |
| 1563 | "{min-emergency-msat:{value_msat:%}}}", |
| 1564 | JSON_SCAN(json_to_msat, &msat)); |
| 1565 | |
| 1566 | emergency_reserve = amount_msat_to_sat_round_down(msat); |
| 1567 | plugin_set_memleak_handler(init_cmd->plugin, memleak_mark); |
| 1568 | |
| 1569 | return NULL; |
| 1570 | } |
| 1571 | |
| 1572 | const struct plugin_hook hooks[] = { |
| 1573 | { |
nothing calls this directly
no test coverage detected