]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Fix expired value being sent as the latest update.
authorArik Sosman <git@arik.io>
Thu, 19 Oct 2023 18:52:06 +0000 (11:52 -0700)
committerArik Sosman <git@arik.io>
Thu, 19 Oct 2023 19:24:38 +0000 (12:24 -0700)
src/lookup.rs

index 8def6f13750fa5cf556ac6c1a1106b6d4b70635a..0878860020a61d373d311f6cff150d101c389c48 100644 (file)
@@ -288,7 +288,7 @@ pub(super) async fn fetch_channel_updates<L: Deref>(delta_set: &mut DeltaSet, cl
                SELECT id, direction, blob_signed, CAST(EXTRACT('epoch' from seen) AS BIGINT) AS seen
                FROM channel_updates
                WHERE seen >= TO_TIMESTAMP($1)
-               ORDER BY timestamp DESC
+               ORDER BY short_channel_id ASC, timestamp DESC
                ", [last_sync_timestamp_float]).await.unwrap();
        let mut pinned_updates = Box::pin(intermediate_updates);
        log_info!(logger, "Fetched intermediate rows in {:?}", start.elapsed());