MCPcopy Create free account
hub / github.com/ElementsProject/lightning / init

Function init

plugins/funder.c:1545–1570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1543}
1544
1545static 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
1572const struct plugin_hook hooks[] = {
1573 {

Callers

nothing calls this directly

Calls 8

list_head_initFunction · 0.85
funder_check_policyFunction · 0.85
plugin_errFunction · 0.70
rpc_scanFunction · 0.70
json_out_objFunction · 0.70

Tested by

no test coverage detected