@@ -8092,6 +8092,7 @@ impl<
80928092 &&logger,
80938093 ),
80948094 htlc_id,
8095+ monitor_event_id,
80958096 ))
80968097 } else {
80978098 self.forwarding_channel_not_found(
@@ -8124,7 +8125,7 @@ impl<
81248125 monitor_event_id,
81258126 &&logger,
81268127 );
8127- Some((res, htlc_id))
8128+ Some((res, htlc_id, monitor_event_id ))
81288129 } else {
81298130 self.forwarding_channel_not_found(
81308131 core::iter::once(forward_info).chain(draining_pending_forwards),
@@ -8137,7 +8138,7 @@ impl<
81378138 }
81388139 },
81398140 };
8140- if let Some((queue_fail_htlc_res, htlc_id)) = queue_fail_htlc_res {
8141+ if let Some((queue_fail_htlc_res, htlc_id, monitor_event_id )) = queue_fail_htlc_res {
81418142 if let Err(e) = queue_fail_htlc_res {
81428143 if let ChannelError::Ignore(msg) = e {
81438144 if let Some(chan) = peer_state
@@ -8161,6 +8162,11 @@ impl<
81618162 // fail-backs are best-effort, we probably already have one
81628163 // pending, and if not that's OK, if not, the channel is on
81638164 // the chain and sending the HTLC-Timeout is their problem.
8165+ // Ack the monitor event since the fail is already pending or
8166+ // the HTLC no longer exists.
8167+ if let Some((event_id, channel_id)) = monitor_event_id {
8168+ self.chain_monitor.ack_monitor_event(channel_id, event_id);
8169+ }
81648170 }
81658171 }
81668172 }
0 commit comments