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

Function main

hsmd/hsmd.c:714–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714int 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!).

Callers

nothing calls this directly

Calls 7

setup_localeFunction · 0.85
status_setup_asyncFunction · 0.85
new_clientFunction · 0.85
is_lightningdFunction · 0.85
io_loopFunction · 0.85
abortFunction · 0.85
subdaemon_setupFunction · 0.50

Tested by

no test coverage detected