@@ -588,17 +588,10 @@ pub(crate) const DISCONNECT_PEER_AWAITING_RESPONSE_TICKS: usize = 2;
588
588
589
589
struct PendingChannelMonitorUpdate {
590
590
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 ,
597
591
}
598
592
599
593
impl_writeable_tlv_based ! ( PendingChannelMonitorUpdate , {
600
594
( 0 , update, required) ,
601
- ( 2 , blocked, required) ,
602
595
} ) ;
603
596
604
597
/// Contains everything about the channel including state, and various flags.
@@ -2289,7 +2282,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2289
2282
debug_assert ! ( false , "If there is a pending blocked monitor we should have MonitorUpdateInProgress set" ) ;
2290
2283
let update = self . build_commitment_no_status_check ( logger) ;
2291
2284
self . context . pending_monitor_updates . push ( PendingChannelMonitorUpdate {
2292
- update, blocked : true ,
2285
+ update,
2293
2286
} ) ;
2294
2287
}
2295
2288
}
@@ -3552,9 +3545,6 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3552
3545
{
3553
3546
assert_eq ! ( self . context. channel_state & ChannelState :: MonitorUpdateInProgress as u32 , ChannelState :: MonitorUpdateInProgress as u32 ) ;
3554
3547
self . context . channel_state &= !( ChannelState :: MonitorUpdateInProgress as u32 ) ;
3555
- for upd in self . context . pending_monitor_updates . iter ( ) {
3556
- debug_assert ! ( upd. blocked) ;
3557
- }
3558
3548
3559
3549
// If we're past (or at) the FundingSent stage on an outbound channel, try to
3560
3550
// (re-)broadcast the funding transaction as we may have declined to broadcast it when we
@@ -4422,9 +4412,6 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4422
4412
/// Returns the next blocked monitor update, if one exists, and a bool which indicates a
4423
4413
/// further blocked monitor update exists after the next.
4424
4414
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
- }
4428
4415
if self . context . pending_monitor_updates . is_empty ( ) { return None ; }
4429
4416
Some ( ( self . context . pending_monitor_updates . remove ( 0 ) . update ,
4430
4417
!self . context . pending_monitor_updates . is_empty ( ) ) )
@@ -4437,7 +4424,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4437
4424
let release_monitor = self . context . pending_monitor_updates . is_empty ( ) ;
4438
4425
if !release_monitor {
4439
4426
self . context . pending_monitor_updates . push ( PendingChannelMonitorUpdate {
4440
- update, blocked : true ,
4427
+ update,
4441
4428
} ) ;
4442
4429
None
4443
4430
} else {
0 commit comments