Skip to content

Commit b08a502

Browse files
committed
Remove the blocked param on ChannelMonitorUpdates in Channel
Now that all `ChannelMonitorUpdate`s stored in `Channel` are blocked we don't need a bool to track it.
1 parent 7f06757 commit b08a502

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

lightning/src/ln/channel.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -588,17 +588,10 @@ pub(crate) const DISCONNECT_PEER_AWAITING_RESPONSE_TICKS: usize = 2;
588588

589589
struct PendingChannelMonitorUpdate {
590590
update: ChannelMonitorUpdate,
591-
/// In some cases we need to delay letting the [`ChannelMonitorUpdate`] go until after an
592-
/// `Event` is processed by the user. This bool indicates the [`ChannelMonitorUpdate`] is
593-
/// blocked on some external event and the [`ChannelManager`] will update us when we're ready.
594-
///
595-
/// [`ChannelManager`]: super::channelmanager::ChannelManager
596-
blocked: bool,
597591
}
598592

599593
impl_writeable_tlv_based!(PendingChannelMonitorUpdate, {
600594
(0, update, required),
601-
(2, blocked, required),
602595
});
603596

604597
/// Contains everything about the channel including state, and various flags.
@@ -2289,7 +2282,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
22892282
debug_assert!(false, "If there is a pending blocked monitor we should have MonitorUpdateInProgress set");
22902283
let update = self.build_commitment_no_status_check(logger);
22912284
self.context.pending_monitor_updates.push(PendingChannelMonitorUpdate {
2292-
update, blocked: true,
2285+
update,
22932286
});
22942287
}
22952288
}
@@ -3552,9 +3545,6 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
35523545
{
35533546
assert_eq!(self.context.channel_state & ChannelState::MonitorUpdateInProgress as u32, ChannelState::MonitorUpdateInProgress as u32);
35543547
self.context.channel_state &= !(ChannelState::MonitorUpdateInProgress as u32);
3555-
for upd in self.context.pending_monitor_updates.iter() {
3556-
debug_assert!(upd.blocked);
3557-
}
35583548

35593549
// If we're past (or at) the FundingSent stage on an outbound channel, try to
35603550
// (re-)broadcast the funding transaction as we may have declined to broadcast it when we
@@ -4422,9 +4412,6 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
44224412
/// Returns the next blocked monitor update, if one exists, and a bool which indicates a
44234413
/// further blocked monitor update exists after the next.
44244414
pub fn unblock_next_blocked_monitor_update(&mut self) -> Option<(ChannelMonitorUpdate, bool)> {
4425-
for upd in self.context.pending_monitor_updates.iter() {
4426-
debug_assert!(upd.blocked);
4427-
}
44284415
if self.context.pending_monitor_updates.is_empty() { return None; }
44294416
Some((self.context.pending_monitor_updates.remove(0).update,
44304417
!self.context.pending_monitor_updates.is_empty()))
@@ -4437,7 +4424,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
44374424
let release_monitor = self.context.pending_monitor_updates.is_empty();
44384425
if !release_monitor {
44394426
self.context.pending_monitor_updates.push(PendingChannelMonitorUpdate {
4440-
update, blocked: true,
4427+
update,
44414428
});
44424429
None
44434430
} else {

0 commit comments

Comments
 (0)