mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +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:
parent
c25ce826ab
commit
3ca7150c03
@ -665,6 +665,10 @@ int main(int argc, char *argv[])
|
||||
* variables. */
|
||||
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. */
|
||||
ld->daemon_dir = find_daemon_dir(ld, argv[0]);
|
||||
if (!ld->daemon_dir)
|
||||
|
Loading…
Reference in New Issue
Block a user