| 712 | } |
| 713 | |
| 714 | int main(int argc, char *argv[]) |
| 715 | { |
| 716 | struct client *master; |
| 717 | |
| 718 | setup_locale(); |
| 719 | |
| 720 | /* This sets up tmpctx, various DEVELOPER options, backtraces, etc. */ |
| 721 | subdaemon_setup(argc, argv); |
| 722 | |
| 723 | /* A trivial daemon_conn just for writing. */ |
| 724 | status_conn = daemon_conn_new(NULL, STDIN_FILENO, NULL, NULL, NULL); |
| 725 | status_setup_async(status_conn); |
| 726 | uintmap_init(&clients); |
| 727 | |
| 728 | master = new_client(NULL, NULL, NULL, 0, |
| 729 | HSM_CAP_MASTER | HSM_CAP_SIGN_GOSSIP | HSM_CAP_ECDH, |
| 730 | REQ_FD); |
| 731 | |
| 732 | /* First client == lightningd. */ |
| 733 | assert(is_lightningd(master)); |
| 734 | |
| 735 | /* When conn closes, everything is freed. */ |
| 736 | io_set_finish(master->conn, master_gone, master); |
| 737 | |
| 738 | /*~ The two NULL args are a list of timers, and the timer which expired: |
| 739 | * we don't have any timers. */ |
| 740 | io_loop(NULL, NULL); |
| 741 | |
| 742 | /*~ This should never be reached: io_loop only exits on io_break which |
| 743 | * we don't call, a timer expiry which we don't have, or all connections |
| 744 | * being closed, and closing the master calls master_gone. */ |
| 745 | abort(); |
| 746 | } |
| 747 | |
| 748 | /*~ Congratulations on making it through the first of the seven dwarves! |
| 749 | * (And Christian wondered why I'm so fond of having separate daemons!). |
nothing calls this directly
no test coverage detected