Skip to content

Commit 6e115db

Browse files
committed
Drop ChannelMonitorUpdate::UpdateFailed as its now unused
1 parent f24502e commit 6e115db

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use crate::prelude::*;
4444
use crate::sync::{RwLock, RwLockReadGuard, Mutex, MutexGuard};
4545
use core::iter::FromIterator;
4646
use core::ops::Deref;
47-
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
47+
use core::sync::atomic::{AtomicUsize, Ordering};
4848
use bitcoin::secp256k1::PublicKey;
4949

5050
#[derive(Clone, Copy, Hash, PartialEq, Eq)]

lightning/src/chain/channelmonitor.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,18 @@ 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
155+
// Note that Completed is currently never serialized to disk as it is generated only in
156+
// ChainMonitor.
160157
(0, Completed) => {
161158
(0, funding_txo, required),
162159
(2, monitor_update_id, required),
163160
},
164161
;
165162
(2, HTLCEvent),
166163
(4, CommitmentTxConfirmed),
167-
(6, UpdateFailed),
164+
// 6 was `UpdateFailed` until LDK 0.0.117
168165
);
169166

170167
/// 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
@@ -6729,8 +6729,7 @@ where
67296729
self.fail_htlc_backwards_internal(&htlc_update.source, &htlc_update.payment_hash, &reason, receiver);
67306730
}
67316731
},
6732-
MonitorEvent::CommitmentTxConfirmed(funding_outpoint) |
6733-
MonitorEvent::UpdateFailed(funding_outpoint) => {
6732+
MonitorEvent::CommitmentTxConfirmed(funding_outpoint) => {
67346733
let counterparty_node_id_opt = match counterparty_node_id {
67356734
Some(cp_id) => Some(cp_id),
67366735
None => {
@@ -6754,12 +6753,7 @@ where
67546753
msg: update
67556754
});
67566755
}
6757-
let reason = if let MonitorEvent::UpdateFailed(_) = monitor_event {
6758-
ClosureReason::ProcessingError { err: "Failed to persist ChannelMonitor update during chain sync".to_string() }
6759-
} else {
6760-
ClosureReason::CommitmentTxConfirmed
6761-
};
6762-
self.issue_channel_close_events(&chan.context, reason);
6756+
self.issue_channel_close_events(&chan.context, ClosureReason::CommitmentTxConfirmed);
67636757
pending_msg_events.push(events::MessageSendEvent::HandleError {
67646758
node_id: chan.context.get_counterparty_node_id(),
67656759
action: msgs::ErrorAction::SendErrorMessage {

0 commit comments

Comments
 (0)