- // get the latest seen update in both directions for this channel
- channels_requiring_reminders.push(scid as i64);
- }
- }
-
- println!("Fetching latest update data for channels requiring reminders");
- let latest_reminder_updates = client.query("
- SELECT DISTINCT ON (short_channel_id, direction) *
- FROM channel_updates
- WHERE short_channel_id = any($1)
- ORDER BY short_channel_id ASC, direction ASC, seen DESC
- ", &[&channels_requiring_reminders]).await.unwrap();
-
- for current_update in latest_reminder_updates {
- let blob: Vec<u8> = current_update.get("blob_signed");
- let mut readable = Cursor::new(blob);
- let unsigned_update = ChannelUpdate::read(&mut readable).unwrap().contents;
- let scid = unsigned_update.short_channel_id;
- let direction: bool = current_update.get("direction");
+ let current_channel_info = read_only_graph.channel(scid).unwrap();
+ if let Some(info) = current_channel_info.one_to_two.as_ref() {
+ let flags: u8 = if info.enabled { 0 } else { 2 };
+ let current_update = (*current_channel_delta).updates.0.get_or_insert(DirectedUpdateDelta::default());
+ current_update.serialization_update_flags = Some(flags);
+ }