Skip to content

Commit 5a36a83

Browse files
committed
Drop ChannelMonitorUpdate::UpdateFailed as its now unused
1 parent 0a2b064 commit 5a36a83

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,15 @@ pub enum MonitorEvent {
150150
/// same [`ChannelMonitor`] have been applied and persisted.
151151
monitor_update_id: u64,
152152
},
153-
154-
/// Indicates a [`ChannelMonitor`] update has failed.
155-
UpdateFailed(OutPoint),
156153
}
157154
impl_writeable_tlv_based_enum_upgradable!(MonitorEvent,
158-
// Note that Completed and UpdateFailed are currently never serialized to disk as they are
159-
// generated only in ChainMonitor
160155
(0, Completed) => {
161156
(0, funding_txo, required),
162157
(2, monitor_update_id, required),
163158
},
164159
;
165160
(2, HTLCEvent),
166161
(4, CommitmentTxConfirmed),
167-
(6, UpdateFailed),
168162
);
169163

170164
/// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6393,8 +6393,7 @@ where
63936393
self.fail_htlc_backwards_internal(&htlc_update.source, &htlc_update.payment_hash, &reason, receiver);
63946394
}
63956395
},
6396-
MonitorEvent::CommitmentTxConfirmed(funding_outpoint) |
6397-
MonitorEvent::UpdateFailed(funding_outpoint) => {
6396+
MonitorEvent::CommitmentTxConfirmed(funding_outpoint) => {
63986397
let counterparty_node_id_opt = match counterparty_node_id {
63996398
Some(cp_id) => Some(cp_id),
64006399
None => {
@@ -6418,12 +6417,7 @@ where
64186417
msg: update
64196418
});
64206419
}
6421-
let reason = if let MonitorEvent::UpdateFailed(_) = monitor_event {
6422-
ClosureReason::ProcessingError { err: "Failed to persist ChannelMonitor update during chain sync".to_string() }
6423-
} else {
6424-
ClosureReason::CommitmentTxConfirmed
6425-
};
6426-
self.issue_channel_close_events(&chan.context, reason);
6420+
self.issue_channel_close_events(&chan.context, ClosureReason::CommitmentTxConfirmed);
64276421
pending_msg_events.push(events::MessageSendEvent::HandleError {
64286422
node_id: chan.context.get_counterparty_node_id(),
64296423
action: msgs::ErrorAction::SendErrorMessage {

0 commit comments

Comments
 (0)