@@ -1520,7 +1520,7 @@ macro_rules! handle_chan_restoration_locked {
15201520 } ) ;
15211521 }
15221522
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( ) {
15241524 let mut pending_events = $self. pending_events. lock( ) . unwrap( ) ;
15251525 emit_channel_ready_event!( pending_events, $channel_entry. get( ) ) ;
15261526 }
@@ -4546,7 +4546,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
45464546 }
45474547
45484548 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) = {
45504550 let best_block = * self . best_block . read ( ) . unwrap ( ) ;
45514551 let mut channel_lock = self . channel_state . lock ( ) . unwrap ( ) ;
45524552 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
46104610 if let Some ( msg) = channel_ready {
46114611 send_channel_ready ! ( channel_state. short_to_chan_info, channel_state. pending_msg_events, chan, msg) ;
46124612 }
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- }
46174613 e. insert ( chan) ;
46184614 }
46194615 }
@@ -4630,7 +4626,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
46304626 if chan. get ( ) . get_counterparty_node_id ( ) != * counterparty_node_id {
46314627 return Err ( MsgHandleErrInternal :: send_err_msg_no_close ( "Got a message for a channel from the wrong node!" . to_owned ( ) , msg. channel_id ) ) ;
46324628 }
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 ) {
46344630 Ok ( update) => update,
46354631 Err ( e) => try_chan_entry ! ( self , Err ( e) , channel_state, chan) ,
46364632 } ;
@@ -4653,10 +4649,6 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
46534649 send_channel_ready ! ( channel_state. short_to_chan_info, channel_state. pending_msg_events, chan. get( ) , msg) ;
46544650 }
46554651
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- }
46604652 funding_tx
46614653 } ,
46624654 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
46984690 }
46994691
47004692 }
4701- if chan. get ( ) . is_usable ( ) && chan . get_mut ( ) . should_emit_channel_ready_event ( ) {
4693+ if chan. get_mut ( ) . should_emit_channel_ready_event ( ) {
47024694 let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
47034695 emit_channel_ready_event ! ( pending_events, chan. get( ) ) ;
47044696 }
0 commit comments