]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Fix ordering of intermediate commits to ensure the latest comes first and is used...
authorArik Sosman <git@arik.io>
Thu, 17 Aug 2023 03:55:51 +0000 (20:55 -0700)
committerArik Sosman <git@arik.io>
Thu, 17 Aug 2023 04:56:31 +0000 (21:56 -0700)
src/lookup.rs

index 90591240b97a75eecb5c9482f20fb442252e8f33..eb0c8eed688bf7dc0690387a6a35d70795c3b32d 100644 (file)
@@ -288,6 +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
                ", [last_sync_timestamp_float]).await.unwrap();
        let mut pinned_updates = Box::pin(intermediate_updates);
        log_info!(logger, "Fetched intermediate rows in {:?}", start.elapsed());