From 10b40c524d59971e3b6024d57a56fa35c0f74e3c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 4 Jan 2018 22:10:58 +1030 Subject: [PATCH] gossipd: attach updates to pending transactions in preference. Otherwise, we otherwise end up with out-of-order updates (ie. preceeding announcements). I assume that is because of the locally-inserted connections. Signed-off-by: Rusty Russell --- gossipd/routing.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index 6fe397b4a..8e72e3af8 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -744,18 +744,20 @@ void handle_channel_update(struct routing_state *rstate, const u8 *update) &short_channel_id), flags & 0x01); + if (update_to_pending(rstate, &short_channel_id, serialized)) { + status_trace("Deferring update for pending channel %s", + type_to_string(trc, struct short_channel_id, + &short_channel_id)); + tal_free(tmpctx); + return; + } + c = get_connection_by_scid(rstate, &short_channel_id, flags & 0x1); if (!c) { - if (update_to_pending(rstate, &short_channel_id, serialized)) { - status_trace("Deferring update for pending channel %s", - type_to_string(trc, struct short_channel_id, - &short_channel_id)); - } else { - status_trace("Ignoring update for unknown channel %s", - type_to_string(trc, struct short_channel_id, - &short_channel_id)); - } + status_trace("Ignoring update for unknown channel %s", + type_to_string(trc, struct short_channel_id, + &short_channel_id)); tal_free(tmpctx); return; } else if (c->last_timestamp >= timestamp) {