From: Arik Sosman Date: Sat, 4 Nov 2023 06:05:26 +0000 (-0700) Subject: Include old updates when necessary. X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=3008d39976fdeeae1a417d15b5e8aa651a72b4eb;p=rapid-gossip-sync-server 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. --- 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)); }