diff --git a/gossipd/routing.c b/gossipd/routing.c index 2d7e87a9b..4a51e63c7 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -875,7 +876,10 @@ static void update_pending(struct pending_cannouncement *pending, type_to_string(tmpctx, struct short_channel_id, &pending->short_channel_id), direction); - if (pending->update_timestamps[direction] < timestamp) { + /* FIXME: This should be <, but in our tests we sometimes can generate + * more than one update per second, and we don't coordinate timestamps + * between gossipd and channeld. */ + if (pending->update_timestamps[direction] <= timestamp) { if (pending->updates[direction]) { status_trace("Replacing existing update"); tal_free(pending->updates[direction]); @@ -1037,7 +1041,14 @@ u8 *handle_channel_update(struct routing_state *rstate, const u8 *update, c = &chan->half[direction]; - if (is_halfchan_defined(c) && c->last_timestamp >= timestamp) { + /* FIXME: This should be >=, but in our tests we sometimes can generate + * more than one update per second, and we don't coordinate timestamps + * between gossipd and channeld. But don't update just because of + * re-transmissions, either. */ + if (is_halfchan_defined(c) + && (c->last_timestamp > timestamp + || memeq(c->channel_update, tal_len(c->channel_update), + serialized, tal_len(serialized)))) { SUPERVERBOSE("Ignoring outdated update."); return NULL; }