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

Function common_setup

common/setup.c:28–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28void common_setup(const char *argv0)
29{
30 int wally_ret;
31
32 setup_locale();
33 err_set_progname(argv0);
34
35 /* We rely on libsodium for some of the crypto stuff, so we'd better
36 * not start if it cannot do its job correctly. */
37 if (sodium_init() == -1)
38 errx(1, "Could not initialize libsodium. Maybe not enough entropy"
39 " available ?");
40
41 /* We set up Wally, the bitcoin wallet lib */
42 wally_ret = wally_init(0);
43 if (wally_ret != WALLY_OK)
44 errx(1, "Error initializing libwally: %i", wally_ret);
45 wally_ret = wally_set_operations(&wally_tal_ops);
46 if (wally_ret != WALLY_OK)
47 errx(1, "Error setting libwally operations: %i", wally_ret);
48 secp256k1_ctx = wally_get_secp_context();
49
50 setup_tmpctx();
51}
52
53void common_shutdown(void)
54{

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 4

setup_localeFunction · 0.85
err_set_prognameFunction · 0.85
errxFunction · 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