+ fn update_monitor(&self, funding_txo: OutPoint, update: channelmonitor::ChannelMonitorUpdate) -> Result<(), channelmonitor::ChannelMonitorUpdateErr> {
+ let mut map_lock = self.latest_monitors.lock().unwrap();
+ let mut map_entry = match map_lock.entry(funding_txo) {
+ hash_map::Entry::Occupied(entry) => entry,
+ hash_map::Entry::Vacant(_) => panic!("Didn't have monitor on update call"),
+ };
+ let mut deserialized_monitor = <(Sha256d, channelmonitor::ChannelMonitor<EnforcingChannelKeys>)>::
+ read(&mut Cursor::new(&map_entry.get().1), Arc::clone(&self.logger)).unwrap().1;
+ deserialized_monitor.update_monitor(update.clone()).unwrap();
+ let mut ser = VecWriter(Vec::new());
+ deserialized_monitor.write_for_disk(&mut ser).unwrap();
+ map_entry.insert((update.update_id, ser.0));
+ self.should_update_manager.store(true, atomic::Ordering::Relaxed);
+ self.update_ret.lock().unwrap().clone()
+ }
+
+ fn get_and_clear_pending_htlcs_updated(&self) -> Vec<HTLCUpdate> {
+ return self.simple_monitor.get_and_clear_pending_htlcs_updated();