@@ -798,6 +798,31 @@ fn test_0conf_channel_with_async_monitor() {
798
798
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 100_000 ) ;
799
799
}
800
800
801
+ #[ test]
802
+ fn test_0conf_close_no_early_chan_update ( ) {
803
+ // Tests that even with a public channel 0conf channel, we don't generate a channel_update on
804
+ // closing.
805
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
806
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
807
+ let mut chan_config = test_default_channel_config ( ) ;
808
+ chan_config. manually_accept_inbound_channels = true ;
809
+
810
+ let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , Some ( chan_config) ] ) ;
811
+ let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
812
+
813
+ // This is the default but we force it on anyway
814
+ chan_config. channel_options . announced_channel = true ;
815
+ open_zero_conf_channel ( & nodes[ 0 ] , & nodes[ 1 ] , Some ( chan_config) ) ;
816
+
817
+ // We can use the channel immediately, but won't generate a channel_update until we get confs
818
+ send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 100_000 ) ;
819
+
820
+ nodes[ 0 ] . node . force_close_all_channels ( ) ;
821
+ check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
822
+ check_closed_event ! ( & nodes[ 0 ] , 1 , ClosureReason :: HolderForceClosed ) ;
823
+ let _ = get_err_msg ! ( nodes[ 0 ] , nodes[ 1 ] . node. get_our_node_id( ) ) ;
824
+ }
825
+
801
826
#[ test]
802
827
fn test_public_0conf_channel ( ) {
803
828
// Tests that we will announce a public channel (after confirmation) even if its 0conf.
0 commit comments