@@ -772,7 +772,9 @@ fn test_upfront_shutdown_script() {
772
772
}
773
773
774
774
// 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) ;
776
778
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 1000000 ) ;
777
779
nodes[ 0 ] . node . close_channel ( & chan. 2 , & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
778
780
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() {
824
826
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
825
827
let mut node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
826
828
// 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) ;
828
832
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
829
833
let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
830
834
@@ -853,7 +857,9 @@ fn test_unsupported_anysegwit_upfront_shutdown_script() {
853
857
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
854
858
let mut node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
855
859
// 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) ;
857
863
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
858
864
let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
859
865
@@ -984,8 +990,10 @@ fn test_unsupported_anysegwit_shutdown_script() {
984
990
let user_cfgs = [ None , Some ( config) , None ] ;
985
991
let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
986
992
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) ;
989
997
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & user_cfgs) ;
990
998
let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
991
999
0 commit comments