@@ -2947,8 +2947,7 @@ fn test_htlc_on_chain_success() {
2947
2947
check_tx_local_broadcast ! ( nodes[ 0 ] , true , commitment_tx[ 0 ] , chan_1. 3 ) ;
2948
2948
}
2949
2949
2950
- #[ test]
2951
- fn test_htlc_on_chain_timeout ( ) {
2950
+ fn do_test_htlc_on_chain_timeout ( connect_style : ConnectStyle ) {
2952
2951
// Test that in case of a unilateral close onchain, we detect the state of output and
2953
2952
// timeout the HTLC backward accordingly. So here we test that ChannelManager is
2954
2953
// broadcasting the right event to other nodes in payment path.
@@ -2961,6 +2960,9 @@ fn test_htlc_on_chain_timeout() {
2961
2960
let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
2962
2961
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
2963
2962
let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
2963
+ * nodes[ 0 ] . connect_style . borrow_mut ( ) = connect_style;
2964
+ * nodes[ 1 ] . connect_style . borrow_mut ( ) = connect_style;
2965
+ * nodes[ 2 ] . connect_style . borrow_mut ( ) = connect_style;
2964
2966
2965
2967
// Create some intial channels
2966
2968
let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
@@ -3074,6 +3076,13 @@ fn test_htlc_on_chain_timeout() {
3074
3076
assert_eq ! ( node_txn[ 2 ] . clone( ) . input[ 0 ] . witness. last( ) . unwrap( ) . len( ) , OFFERED_HTLC_SCRIPT_WEIGHT ) ;
3075
3077
}
3076
3078
3079
+ #[ test]
3080
+ fn test_htlc_on_chain_timeout ( ) {
3081
+ do_test_htlc_on_chain_timeout ( ConnectStyle :: BestBlockFirstSkippingBlocks ) ;
3082
+ do_test_htlc_on_chain_timeout ( ConnectStyle :: TransactionsFirstSkippingBlocks ) ;
3083
+ do_test_htlc_on_chain_timeout ( ConnectStyle :: FullBlockViaListen ) ;
3084
+ }
3085
+
3077
3086
#[ test]
3078
3087
fn test_simple_commitment_revoked_fail_backward ( ) {
3079
3088
// Test that in case of a revoked commitment tx, we detect the resolution of output by justice tx
0 commit comments