@@ -772,7 +772,9 @@ fn test_upfront_shutdown_script() {
772772 }
773773
774774 // We test that if case of peer non-signaling we don't enforce committed script at channel opening
775- * nodes[ 0 ] . override_init_features . borrow_mut ( ) = Some ( nodes[ 0 ] . node . init_features ( ) . clear_upfront_shutdown_script ( ) ) ;
775+ let mut features = nodes[ 0 ] . node . init_features ( ) ;
776+ features. clear_upfront_shutdown_script ( ) ;
777+ * nodes[ 0 ] . override_init_features . borrow_mut ( ) = Some ( features) ;
776778 let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 1000000 ) ;
777779 nodes[ 0 ] . node . close_channel ( & chan. 2 , & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
778780 let node_1_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 1 ] . node. get_our_node_id( ) ) ;
@@ -824,7 +826,9 @@ fn test_unsupported_anysegwit_upfront_shutdown_script() {
824826 let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
825827 let mut node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
826828 // Clear shutdown_anysegwit on initiator
827- * node_cfgs[ 0 ] . override_init_features . borrow_mut ( ) = Some ( channelmanager:: provided_init_features ( & test_default_channel_config ( ) ) . clear_shutdown_anysegwit ( ) ) ;
829+ let mut features = channelmanager:: provided_init_features ( & test_default_channel_config ( ) ) ;
830+ features. clear_shutdown_anysegwit ( ) ;
831+ * node_cfgs[ 0 ] . override_init_features . borrow_mut ( ) = Some ( features) ;
828832 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
829833 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
830834
@@ -853,7 +857,9 @@ fn test_unsupported_anysegwit_upfront_shutdown_script() {
853857 let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
854858 let mut node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
855859 // Clear shutdown_anysegwit on responder
856- * node_cfgs[ 1 ] . override_init_features . borrow_mut ( ) = Some ( channelmanager:: provided_init_features ( & test_default_channel_config ( ) ) . clear_shutdown_anysegwit ( ) ) ;
860+ let mut features = channelmanager:: provided_init_features ( & test_default_channel_config ( ) ) ;
861+ features. clear_shutdown_anysegwit ( ) ;
862+ * node_cfgs[ 1 ] . override_init_features . borrow_mut ( ) = Some ( features) ;
857863 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
858864 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
859865
@@ -984,8 +990,10 @@ fn test_unsupported_anysegwit_shutdown_script() {
984990 let user_cfgs = [ None , Some ( config) , None ] ;
985991 let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
986992 let mut node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
987- * node_cfgs[ 0 ] . override_init_features . borrow_mut ( ) = Some ( channelmanager:: provided_init_features ( & config) . clear_shutdown_anysegwit ( ) ) ;
988- * node_cfgs[ 1 ] . override_init_features . borrow_mut ( ) = Some ( channelmanager:: provided_init_features ( & config) . clear_shutdown_anysegwit ( ) ) ;
993+ let mut features = channelmanager:: provided_init_features ( & config) ;
994+ features. clear_shutdown_anysegwit ( ) ;
995+ * node_cfgs[ 0 ] . override_init_features . borrow_mut ( ) = Some ( features. clone ( ) ) ;
996+ * node_cfgs[ 1 ] . override_init_features . borrow_mut ( ) = Some ( features) ;
989997 let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & user_cfgs) ;
990998 let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
991999
0 commit comments