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

Function common_setup

common/setup.c:38–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void common_setup(const char *argv0)
39{
40 int wally_ret;
41
42 setup_locale();
43 err_set_progname(argv0);
44
45 /* We rely on libsodium for some of the crypto stuff, so we'd better
46 * not start if it cannot do its job correctly. */
47 if (sodium_init() == -1)
48 errx(1, "Could not initialize libsodium. Maybe not enough entropy"
49 " available ?");
50
51 /* We set up Wally, the bitcoin wallet lib */
52 wally_ret = wally_init(0);
53 if (wally_ret != WALLY_OK)
54 errx(1, "Error initializing libwally: %i", wally_ret);
55 wally_ret = wally_set_operations(&wally_tal_ops);
56 if (wally_ret != WALLY_OK)
57 errx(1, "Error setting libwally operations: %i", wally_ret);
58 secp256k1_ctx = wally_get_secp_context();
59
60 /* Make htable* use tal for the tables themselves. */
61 htable_set_allocator(htable_tal, htable_tal_free);
62
63 setup_tmpctx();
64}
65
66void common_shutdown(void)
67{

Callers 15

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 5

setup_localeFunction · 0.85
err_set_prognameFunction · 0.85
errxFunction · 0.85
htable_set_allocatorFunction · 0.85
setup_tmpctxFunction · 0.85

Tested by 15

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68