Avoid refusing ChannelMonitorUpdates we expect to receive after closing
[rust-lightning] / lightning / src / chain / channelmonitor.rs
index df5160df015fae8550c487660d0a959c59687fe6..97e1e8ee6125e2f583cf9a1aaa155a9121a0e60d 100644 (file)
@@ -2373,6 +2373,13 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
                                },
                        }
                }
+
+               // If the updates succeeded and we were in an already closed channel state, then there's no
+               // need to refuse any updates we expect to receive afer seeing a confirmed commitment.
+               if ret.is_ok() && updates.update_id == CLOSED_CHANNEL_UPDATE_ID && self.latest_update_id == updates.update_id {
+                       return Ok(());
+               }
+
                self.latest_update_id = updates.update_id;
 
                if ret.is_ok() && self.funding_spend_seen {