Remove bogus mon_update_id += 1 fulfilling already-fulfilled HTLCs
[rust-lightning] / lightning / src / ln / channel.rs
index a9565af9e06baf013a33384561e1bf1c12fc827a..b4c0a90cb3964e3cf99ae3d857ad5d4d4e04346b 100644 (file)
@@ -1200,6 +1200,8 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
                                match pending_update {
                                        &HTLCUpdateAwaitingACK::ClaimHTLC { htlc_id, .. } => {
                                                if htlc_id_arg == htlc_id {
+                                                       // Make sure we don't leave latest_monitor_update_id incremented here:
+                                                       self.latest_monitor_update_id -= 1;
                                                        return Ok((None, None));
                                                }
                                        },