@@ -585,17 +585,10 @@ pub(crate) const DISCONNECT_PEER_AWAITING_RESPONSE_TICKS: usize = 2;
585
585
586
586
struct PendingChannelMonitorUpdate {
587
587
update : ChannelMonitorUpdate ,
588
- /// In some cases we need to delay letting the [`ChannelMonitorUpdate`] go until after an
589
- /// `Event` is processed by the user. This bool indicates the [`ChannelMonitorUpdate`] is
590
- /// blocked on some external event and the [`ChannelManager`] will update us when we're ready.
591
- ///
592
- /// [`ChannelManager`]: super::channelmanager::ChannelManager
593
- blocked : bool ,
594
588
}
595
589
596
590
impl_writeable_tlv_based ! ( PendingChannelMonitorUpdate , {
597
591
( 0 , update, required) ,
598
- ( 2 , blocked, required) ,
599
592
} ) ;
600
593
601
594
/// Contains everything about the channel including state, and various flags.
@@ -2286,7 +2279,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2286
2279
debug_assert ! ( false , "If there is a pending blocked monitor we should have MonitorUpdateInProgress set" ) ;
2287
2280
let update = self . build_commitment_no_status_check ( logger) ;
2288
2281
self . context . pending_monitor_updates . push ( PendingChannelMonitorUpdate {
2289
- update, blocked : true ,
2282
+ update,
2290
2283
} ) ;
2291
2284
}
2292
2285
}
@@ -3546,9 +3539,6 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3546
3539
{
3547
3540
assert_eq ! ( self . context. channel_state & ChannelState :: MonitorUpdateInProgress as u32 , ChannelState :: MonitorUpdateInProgress as u32 ) ;
3548
3541
self . context . channel_state &= !( ChannelState :: MonitorUpdateInProgress as u32 ) ;
3549
- for upd in self . context . pending_monitor_updates . iter ( ) {
3550
- debug_assert ! ( upd. blocked) ;
3551
- }
3552
3542
3553
3543
// If we're past (or at) the FundingSent stage on an outbound channel, try to
3554
3544
// (re-)broadcast the funding transaction as we may have declined to broadcast it when we
@@ -4415,9 +4405,6 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4415
4405
/// Returns the next blocked monitor update, if one exists, and a bool which indicates a
4416
4406
/// further blocked monitor update exists after the next.
4417
4407
pub fn unblock_next_blocked_monitor_update ( & mut self ) -> Option < ( ChannelMonitorUpdate , bool ) > {
4418
- for upd in self . context . pending_monitor_updates . iter ( ) {
4419
- debug_assert ! ( upd. blocked) ;
4420
- }
4421
4408
if self . context . pending_monitor_updates . is_empty ( ) { return None ; }
4422
4409
Some ( ( self . context . pending_monitor_updates . remove ( 0 ) . update ,
4423
4410
!self . context . pending_monitor_updates . is_empty ( ) ) )
@@ -4430,7 +4417,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4430
4417
let release_monitor = self . context . pending_monitor_updates . is_empty ( ) ;
4431
4418
if !release_monitor {
4432
4419
self . context . pending_monitor_updates . push ( PendingChannelMonitorUpdate {
4433
- update, blocked : true ,
4420
+ update,
4434
4421
} ) ;
4435
4422
None
4436
4423
} else {
0 commit comments