| 618 | #endif |
| 619 | |
| 620 | static const char *init(struct plugin *p, |
| 621 | const char *buf UNUSED, const jsmntok_t *config UNUSED) |
| 622 | { |
| 623 | size_t num_cupdates_rejected; |
| 624 | |
| 625 | plugin = p; |
| 626 | rpc_scan(p, "getinfo", |
| 627 | take(json_out_obj(NULL, NULL, NULL)), |
| 628 | "{id:%}", JSON_SCAN(json_to_node_id, &local_id)); |
| 629 | |
| 630 | global_gossmap = gossmap_load(NULL, |
| 631 | GOSSIP_STORE_FILENAME, |
| 632 | &num_cupdates_rejected); |
| 633 | if (!global_gossmap) |
| 634 | plugin_err(plugin, "Could not load gossmap %s: %s", |
| 635 | GOSSIP_STORE_FILENAME, strerror(errno)); |
| 636 | |
| 637 | if (num_cupdates_rejected) |
| 638 | plugin_log(plugin, LOG_DBG, |
| 639 | "gossmap ignored %zu channel updates", |
| 640 | num_cupdates_rejected); |
| 641 | #if DEVELOPER |
| 642 | plugin_set_memleak_handler(p, memleak_mark); |
| 643 | #endif |
| 644 | return NULL; |
| 645 | } |
| 646 | |
| 647 | static const struct plugin_command commands[] = { |
| 648 | { |
nothing calls this directly
no test coverage detected