From 04eb101aa689519a2284e5d02e14f750f94d96e4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 28 Feb 2018 06:30:45 +1030 Subject: [PATCH] routing: handle pending replies which are missing. I'm not completely conviced that we can't end up removing pending things, so change asserts to simple returns. Signed-off-by: Rusty Russell --- gossipd/routing.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index a80d9bf9a..235b1380a 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -768,11 +768,15 @@ bool handle_pending_cannouncement(struct routing_state *rstate, struct routing_channel *chan; u64 uscid = short_channel_id_to_uint(scid); + /* There may be paths which can clean this up, eg. error processing. */ chan = uintmap_get(&rstate->channels, uscid); - assert(chan); + if (!chan) + return false; pending = chan->pending; - assert(pending); + /* We could imagine this being cleaned up, then recreated. */ + if (!pending) + return false; chan->pending = NULL; tag = tal_arr(pending, u8, 0);