@@ -2940,8 +2940,7 @@ fn test_htlc_on_chain_success() {
2940
2940
check_tx_local_broadcast ! ( nodes[ 0 ] , true , commitment_tx[ 0 ] , chan_1. 3 ) ;
2941
2941
}
2942
2942
2943
- #[ test]
2944
- fn test_htlc_on_chain_timeout ( ) {
2943
+ fn do_test_htlc_on_chain_timeout ( connect_style : ConnectStyle ) {
2945
2944
// Test that in case of a unilateral close onchain, we detect the state of output and
2946
2945
// timeout the HTLC backward accordingly. So here we test that ChannelManager is
2947
2946
// broadcasting the right event to other nodes in payment path.
@@ -2953,7 +2952,10 @@ fn test_htlc_on_chain_timeout() {
2953
2952
let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
2954
2953
let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
2955
2954
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
2956
- let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
2955
+ let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
2956
+ * nodes[ 0 ] . connect_style . borrow_mut ( ) = connect_style;
2957
+ * nodes[ 1 ] . connect_style . borrow_mut ( ) = connect_style;
2958
+ * nodes[ 2 ] . connect_style . borrow_mut ( ) = connect_style;
2957
2959
2958
2960
// Create some intial channels
2959
2961
let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
@@ -3067,6 +3069,13 @@ fn test_htlc_on_chain_timeout() {
3067
3069
assert_eq ! ( node_txn[ 2 ] . clone( ) . input[ 0 ] . witness. last( ) . unwrap( ) . len( ) , OFFERED_HTLC_SCRIPT_WEIGHT ) ;
3068
3070
}
3069
3071
3072
+ #[ test]
3073
+ fn test_htlc_on_chain_timeout ( ) {
3074
+ do_test_htlc_on_chain_timeout ( ConnectStyle :: BestBlockFirstSkippingBlocks ) ;
3075
+ do_test_htlc_on_chain_timeout ( ConnectStyle :: TransactionsFirstSkippingBlocks ) ;
3076
+ do_test_htlc_on_chain_timeout ( ConnectStyle :: FullBlockViaListen ) ;
3077
+ }
3078
+
3070
3079
#[ test]
3071
3080
fn test_simple_commitment_revoked_fail_backward ( ) {
3072
3081
// Test that in case of a revoked commitment tx, we detect the resolution of output by justice tx
0 commit comments