Skip to content

Commit 70a0dff

Browse files
committed
f assert that removed updates are actually ready to be removed
1 parent ee28cdc commit 70a0dff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5045,7 +5045,12 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
50455045
}
50465046

50475047
pub fn complete_all_mon_updates_through(&mut self, update_id: u64) {
5048-
self.pending_monitor_updates.retain(|upd| upd.update.update_id > update_id);
5048+
self.pending_monitor_updates.retain(|upd| {
5049+
if upd.update.update_id <= update_id {
5050+
assert!(!upd.blocked, "Completed update must have flown");
5051+
false
5052+
} else { true }
5053+
});
50495054
}
50505055

50515056
pub fn complete_one_mon_update(&mut self, update_id: u64) {

0 commit comments

Comments
 (0)