@@ -4253,8 +4253,6 @@ where
4253
4253
} ) ;
4254
4254
}
4255
4255
4256
- emit_channel_ready_event ! ( self , channel) ;
4257
-
4258
4256
macro_rules! handle_cs { ( ) => {
4259
4257
if let Some ( update) = commitment_update {
4260
4258
pending_msg_events. push( events:: MessageSendEvent :: UpdateHTLCs {
@@ -4285,8 +4283,19 @@ where
4285
4283
if let Some ( tx) = funding_broadcastable {
4286
4284
log_info ! ( self . logger, "Broadcasting funding transaction with txid {}" , tx. txid( ) ) ;
4287
4285
self . tx_broadcaster . broadcast_transaction ( & tx) ;
4286
+
4287
+ let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
4288
+ pending_events. push ( events:: Event :: ChannelPending {
4289
+ channel_id : channel. channel_id ( ) ,
4290
+ former_temporary_channel_id : channel. temporary_channel_id ( ) ,
4291
+ counterparty_node_id : counterparty_node_id,
4292
+ user_channel_id : channel. get_user_id ( ) ,
4293
+ funding_txo : channel. get_funding_txo ( ) . unwrap ( ) . into_bitcoin_outpoint ( ) ,
4294
+ } ) ;
4288
4295
}
4289
4296
4297
+ emit_channel_ready_event ! ( self , channel) ;
4298
+
4290
4299
htlc_forwards
4291
4300
}
4292
4301
@@ -4673,10 +4682,7 @@ where
4673
4682
hash_map:: Entry :: Occupied ( mut chan) => {
4674
4683
let monitor = try_chan_entry ! ( self ,
4675
4684
chan. get_mut( ) . funding_signed( & msg, best_block, & self . signer_provider, & self . logger) , chan) ;
4676
- let funding_txo = chan. get ( ) . get_funding_txo ( ) . unwrap ( ) ;
4677
- let user_channel_id = chan. get ( ) . get_user_id ( ) ;
4678
- let former_temporary_channel_id = chan. get ( ) . temporary_channel_id ( ) ;
4679
- let update_res = self . chain_monitor . watch_channel ( funding_txo, monitor) ;
4685
+ let update_res = self . chain_monitor . watch_channel ( chan. get ( ) . get_funding_txo ( ) . unwrap ( ) , monitor) ;
4680
4686
let mut res = handle_new_monitor_update ! ( self , update_res, 0 , peer_state_lock, peer_state, per_peer_state, chan) ;
4681
4687
if let Err ( MsgHandleErrInternal { ref mut shutdown_finish, .. } ) = res {
4682
4688
// We weren't able to watch the channel to begin with, so no updates should be made on
@@ -4685,15 +4691,6 @@ where
4685
4691
if let Some ( ( ref mut shutdown_finish, _) ) = shutdown_finish {
4686
4692
shutdown_finish. 0 . take ( ) ;
4687
4693
}
4688
- } else {
4689
- let mut pending_events = self . pending_events . lock ( ) . unwrap ( ) ;
4690
- pending_events. push ( events:: Event :: ChannelPending {
4691
- channel_id : msg. channel_id ,
4692
- former_temporary_channel_id,
4693
- counterparty_node_id : * counterparty_node_id,
4694
- user_channel_id,
4695
- funding_txo : funding_txo. into_bitcoin_outpoint ( ) ,
4696
- } ) ;
4697
4694
}
4698
4695
res
4699
4696
} ,
0 commit comments