Skip to content

Commit

Permalink
lightningd: Move onchaind replay and gossipd activation after daemoni…
Browse files Browse the repository at this point in the history
…zation

Fixes: ElementsProject#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.
  • Loading branch information
ZmnSCPxj authored and cdecker committed May 3, 2018
1 parent c6af2a8 commit 333dcbf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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),
Expand Down

0 comments on commit 333dcbf

Please sign in to comment.