@@ -1520,7 +1520,7 @@ macro_rules! handle_chan_restoration_locked {
1520
1520
} ) ;
1521
1521
}
1522
1522
1523
- if $channel_entry. get ( ) . is_usable ( ) && $channel_entry . get_mut( ) . should_emit_channel_ready_event( ) {
1523
+ if $channel_entry. get_mut( ) . should_emit_channel_ready_event( ) {
1524
1524
let mut pending_events = $self. pending_events. lock( ) . unwrap( ) ;
1525
1525
emit_channel_ready_event!( pending_events, $channel_entry. get( ) ) ;
1526
1526
}
@@ -4546,7 +4546,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
4546
4546
}
4547
4547
4548
4548
fn internal_funding_created ( & self , counterparty_node_id : & PublicKey , msg : & msgs:: FundingCreated ) -> Result < ( ) , MsgHandleErrInternal > {
4549
- let ( ( funding_msg, monitor, ( mut channel_ready, emit_channel_ready_event ) ) , mut chan) = {
4549
+ let ( ( funding_msg, monitor, ( mut channel_ready, _emit_channel_ready_event ) ) , mut chan) = {
4550
4550
let best_block = * self . best_block . read ( ) . unwrap ( ) ;
4551
4551
let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
4552
4552
let channel_state = & mut * channel_lock;
@@ -4610,10 +4610,6 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
4610
4610
if let Some ( msg) = channel_ready {
4611
4611
send_channel_ready ! ( channel_state. short_to_chan_info, channel_state. pending_msg_events, chan, msg) ;
4612
4612
}
4613
- if emit_channel_ready_event {
4614
- let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
4615
- emit_channel_ready_event ! ( pending_events, chan) ;
4616
- }
4617
4613
e. insert ( chan) ;
4618
4614
}
4619
4615
}
@@ -4630,7 +4626,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
4630
4626
if chan. get ( ) . get_counterparty_node_id ( ) != * counterparty_node_id {
4631
4627
return Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Got a message for a channel from the wrong node!" . to_owned ( ) , msg. channel_id ) ) ;
4632
4628
}
4633
- let ( monitor, funding_tx, ( channel_ready, emit_channel_ready_event ) ) = match chan. get_mut ( ) . funding_signed ( & msg, best_block, & self . logger ) {
4629
+ let ( monitor, funding_tx, ( channel_ready, _emit_channel_ready_event ) ) = match chan. get_mut ( ) . funding_signed ( & msg, best_block, & self . logger ) {
4634
4630
Ok ( update) => update,
4635
4631
Err ( e) => try_chan_entry ! ( self , Err ( e) , channel_state, chan) ,
4636
4632
} ;
@@ -4653,10 +4649,6 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
4653
4649
send_channel_ready ! ( channel_state. short_to_chan_info, channel_state. pending_msg_events, chan. get( ) , msg) ;
4654
4650
}
4655
4651
4656
- if emit_channel_ready_event {
4657
- let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
4658
- emit_channel_ready_event ! ( pending_events, chan. get( ) ) ;
4659
- }
4660
4652
funding_tx
4661
4653
} ,
4662
4654
hash_map:: Entry :: Vacant ( _) => return Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Failed to find corresponding channel" . to_owned ( ) , msg. channel_id ) )
@@ -4698,7 +4690,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
4698
4690
}
4699
4691
4700
4692
}
4701
- if chan. get ( ) . is_usable ( ) && chan . get_mut ( ) . should_emit_channel_ready_event ( ) {
4693
+ if chan. get_mut ( ) . should_emit_channel_ready_event ( ) {
4702
4694
let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
4703
4695
emit_channel_ready_event ! ( pending_events, chan. get( ) ) ;
4704
4696
}
0 commit comments