mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: initialize global chainparams in main.
Otherwise the global is only set when passing the '--network' startup option, hence causing a segfault when not passed.
This commit is contained in:
@@ -665,6 +665,10 @@ int main(int argc, char *argv[])
|
|||||||
* variables. */
|
* variables. */
|
||||||
ld = new_lightningd(NULL);
|
ld = new_lightningd(NULL);
|
||||||
|
|
||||||
|
/*~ The global chainparams is needed to init subdaemons, and defaults
|
||||||
|
* to testnet. */
|
||||||
|
chainparams = chainparams_for_network("testnet");
|
||||||
|
|
||||||
/* Figure out where our daemons are first. */
|
/* Figure out where our daemons are first. */
|
||||||
ld->daemon_dir = find_daemon_dir(ld, argv[0]);
|
ld->daemon_dir = find_daemon_dir(ld, argv[0]);
|
||||||
if (!ld->daemon_dir)
|
if (!ld->daemon_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user