From 9d721ecb994813a84c9c631deb23117678bbd0d9 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 15 Jun 2018 10:42:23 +0930 Subject: [PATCH] gossipd: add assertions to try to catch mysterious crash. Signed-off-by: Rusty Russell --- gossipd/gossip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gossipd/gossip.c b/gossipd/gossip.c index 72eb5bf87..4f36026ae 100644 --- a/gossipd/gossip.c +++ b/gossipd/gossip.c @@ -1561,7 +1561,10 @@ static struct io_plan *peer_pkt_out(struct io_conn *conn, struct peer *peer) /* First priority is queued packets, if any */ const u8 *out; + assert(peer->local); again: + /* Second assert may trigger if something happens due to loop */ + assert(peer->local); out = msg_dequeue(&peer->local->peer_out); if (out) { if (is_all_channel_error(out))