From 3008d39976fdeeae1a417d15b5e8aa651a72b4eb Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Fri, 3 Nov 2023 23:05:26 -0700 Subject: [PATCH] Include old updates when necessary. When a channel has only recently become bidirectional, but there has not been a new update in the old direction since the last sync, the latest update in the old direction must still be included in full because it is the first time the full channel is being snapshotted. --- src/serialization.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/serialization.rs b/src/serialization.rs index 93bd381..7e58b02 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -187,6 +187,10 @@ pub(super) fn serialize_delta_set(delta_set: DeltaSet, last_sync_timestamp: u32) record_full_update_in_histograms(&latest_update); serialization_set.updates.push(UpdateSerialization::Full(latest_update)); } + } else if is_newly_included_announcement { + if let Some(unannounced_update) = updates.last_update_before_seen { + serialization_set.updates.push(UpdateSerialization::Full(unannounced_update.update)); + } } else if let Some(flags) = updates.serialization_update_flags { serialization_set.updates.push(UpdateSerialization::Reminder(scid, flags)); } -- 2.39.5