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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-02-28 06:30:45 +10:30 committed by Christian Decker
parent 60e20b502e
commit 04eb101aa6

View File

@ -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);