mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
lightningd: Move onchaind replay and gossipd activation after daemonization
Fixes: #1445 Hacky fix, possibly. First cut at avoiding starting up onchaind and gossipd (which might make queries of chaintopology, which might start up a bitcoin-cli) before we can daemonize.
This commit is contained in:
parent
c6af2a8cb2
commit
333dcbf373
@ -394,13 +394,6 @@ int main(int argc, char *argv[])
|
||||
ld->config.poll_time,
|
||||
blockheight);
|
||||
|
||||
/* Activate gossip daemon. Needs to be after the initialization of
|
||||
* chaintopology, otherwise we may be asking for uninitialized data. */
|
||||
gossip_activate(ld);
|
||||
|
||||
/* Replay transactions for all running onchainds */
|
||||
onchaind_replay_channels(ld);
|
||||
|
||||
/* Create RPC socket (if any) */
|
||||
setup_jsonrpc(ld, ld->rpc_filename);
|
||||
|
||||
@ -411,6 +404,13 @@ int main(int argc, char *argv[])
|
||||
/* Create PID file */
|
||||
pidfile_create(ld);
|
||||
|
||||
/* Activate gossip daemon. Needs to be after the initialization of
|
||||
* chaintopology, otherwise we may be asking for uninitialized data. */
|
||||
gossip_activate(ld);
|
||||
|
||||
/* Replay transactions for all running onchainds */
|
||||
onchaind_replay_channels(ld);
|
||||
|
||||
/* Mark ourselves live. */
|
||||
log_info(ld->log, "Server started with public key %s, alias %s (color #%s) and lightningd %s",
|
||||
type_to_string(tmpctx, struct pubkey, &ld->id),
|
||||
|
Loading…
Reference in New Issue
Block a user