Skip to content

Commit e1fb537

Browse files
committed
Rename Channel's latest-monitor-update fetch method for clarity
`Channel::get_latest_complete_monitor_update_id` no longer refers to complete updates, but rather ones which were passed to the `ChannelManager` and which the `CHannel` no longer knows about. Thus, we rename it `get_latest_unblocked_monitor_update_id`.
1 parent 566f3d2 commit e1fb537

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lightning/src/ln/channel.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4404,7 +4404,8 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
44044404
(self.context.channel_state & ChannelState::MonitorUpdateInProgress as u32) != 0
44054405
}
44064406

4407-
pub fn get_latest_complete_monitor_update_id(&self) -> u64 {
4407+
/// Gets the latest [`ChannelMonitorUpdate`] ID which has been released and is in-flight.
4408+
pub fn get_latest_unblocked_monitor_update_id(&self) -> u64 {
44084409
if self.context.pending_monitor_updates.is_empty() { return self.context.get_latest_monitor_update_id(); }
44094410
self.context.pending_monitor_updates[0].update.update_id - 1
44104411
}

lightning/src/ln/channelmanager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8441,7 +8441,7 @@ where
84418441
funding_txo, monitor, peer_state, ""));
84428442
}
84438443
}
8444-
if chan.get_latest_complete_monitor_update_id() > max_in_flight_update_id {
8444+
if chan.get_latest_unblocked_monitor_update_id() > max_in_flight_update_id {
84458445
// If the channel is ahead of the monitor, return InvalidValue:
84468446
log_error!(args.logger, "A ChannelMonitor is stale compared to the current ChannelManager! This indicates a potentially-critical violation of the chain::Watch API!");
84478447
log_error!(args.logger, " The ChannelMonitor for channel {} is at update_id {} with update_id through {} in-flight",

0 commit comments

Comments
 (0)