- let release_monitor = self.context.pending_monitor_updates.iter().all(|upd| !upd.blocked);
- self.context.pending_monitor_updates.push(PendingChannelMonitorUpdate {
- update, blocked: !release_monitor,
- });
- if release_monitor { self.context.pending_monitor_updates.last().map(|upd| upd.update.clone()) } else { None }
- }
-
- pub fn no_monitor_updates_pending(&self) -> bool {
- self.context.pending_monitor_updates.is_empty()
- }
-
- pub fn complete_all_mon_updates_through(&mut self, update_id: u64) {
- self.context.pending_monitor_updates.retain(|upd| {
- if upd.update.update_id <= update_id {
- assert!(!upd.blocked, "Completed update must have flown");
- false
- } else { true }
- });
- }
-
- pub fn complete_one_mon_update(&mut self, update_id: u64) {
- self.context.pending_monitor_updates.retain(|upd| upd.update.update_id != update_id);
+ let release_monitor = self.context.blocked_monitor_updates.is_empty();
+ if !release_monitor {
+ self.context.blocked_monitor_updates.push(PendingChannelMonitorUpdate {
+ update,
+ });
+ None
+ } else {
+ Some(update)
+ }