Move pending-HTLC-updated ChannelMonitor from ManyChannelMonitor
[rust-lightning] / lightning / src / ln / channelmanager.rs
index 015894e594dc1246efecef452d312171eed099ba..5cc9783c008378374b5e7b2527bbec189b2fdf1f 100644 (file)
@@ -2549,7 +2549,7 @@ impl<ChanSigner: ChannelKeys, M: Deref> events::MessageSendEventsProvider for Ch
                // restart. This is doubly true for the fail/fulfill-backs from monitor events!
                {
                        //TODO: This behavior should be documented.
-                       for htlc_update in self.monitor.fetch_pending_htlc_updated() {
+                       for htlc_update in self.monitor.get_and_clear_pending_htlcs_updated() {
                                if let Some(preimage) = htlc_update.payment_preimage {
                                        log_trace!(self, "Claiming HTLC with preimage {} from our monitor", log_bytes!(preimage.0));
                                        self.claim_funds_internal(self.channel_state.lock().unwrap(), htlc_update.source, preimage);
@@ -2574,7 +2574,7 @@ impl<ChanSigner: ChannelKeys, M: Deref> events::EventsProvider for ChannelManage
                // restart. This is doubly true for the fail/fulfill-backs from monitor events!
                {
                        //TODO: This behavior should be documented.
-                       for htlc_update in self.monitor.fetch_pending_htlc_updated() {
+                       for htlc_update in self.monitor.get_and_clear_pending_htlcs_updated() {
                                if let Some(preimage) = htlc_update.payment_preimage {
                                        log_trace!(self, "Claiming HTLC with preimage {} from our monitor", log_bytes!(preimage.0));
                                        self.claim_funds_internal(self.channel_state.lock().unwrap(), htlc_update.source, preimage);