@@ -19,7 +19,7 @@ use ln::functional_test_utils::*;
19
19
fn test_simple_monitor_permanent_update_fail ( ) {
20
20
// Test that we handle a simple permanent monitor update failure
21
21
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
22
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
22
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
23
23
24
24
let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
25
25
let ( _, payment_hash_1) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -49,7 +49,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
49
49
// Test that we can recover from a simple temporary monitor update failure optionally with
50
50
// a disconnect in between
51
51
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
52
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
52
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
53
53
54
54
let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
55
55
let ( payment_preimage_1, payment_hash_1) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -148,7 +148,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
148
148
// through, swapping message ordering based on disconnect_count & 8 and optionally
149
149
// disconnect/reconnecting based on disconnect_count.
150
150
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
151
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
151
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
152
152
153
153
let ( payment_preimage_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
154
154
@@ -474,7 +474,7 @@ fn test_monitor_temporary_update_fail_c() {
474
474
fn test_monitor_update_fail_cs ( ) {
475
475
// Tests handling of a monitor update failure when processing an incoming commitment_signed
476
476
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
477
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
477
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
478
478
479
479
let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
480
480
let ( payment_preimage, our_payment_hash) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -553,7 +553,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
553
553
// test_restore_channel_monitor() is required. Backported from
554
554
// chanmon_fail_consistency fuzz tests.
555
555
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
556
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
556
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
557
557
558
558
let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
559
559
let ( payment_preimage_1, our_payment_hash) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -595,7 +595,7 @@ fn test_monitor_update_raa_while_paused() {
595
595
// Tests handling of an RAA while monitor updating has already been marked failed.
596
596
// Backported from chanmon_fail_consistency fuzz tests as this used to be broken.
597
597
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
598
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
598
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
599
599
600
600
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 5000000 , 5_000_000 ) ;
601
601
@@ -662,8 +662,8 @@ fn test_monitor_update_raa_while_paused() {
662
662
fn do_test_monitor_update_fail_raa ( test_ignore_second_cs : bool ) {
663
663
// Tests handling of a monitor update failure when processing an incoming RAA
664
664
let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
665
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
666
- let chan_2 = create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
665
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
666
+ let chan_2 = create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
667
667
668
668
// Rebalance a bit so that we can send backwards from 2 to 1.
669
669
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 , 5_000_000 ) ;
@@ -915,8 +915,8 @@ fn test_monitor_update_fail_reestablish() {
915
915
// channel_reestablish generating a monitor update (which comes from freeing holding cell
916
916
// HTLCs).
917
917
let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
918
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
919
- create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
918
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
919
+ create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
920
920
921
921
let ( our_payment_preimage, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 1000000 ) ;
922
922
@@ -993,7 +993,7 @@ fn raa_no_response_awaiting_raa_state() {
993
993
// in question (assuming it intends to respond with a CS after monitor updating is restored).
994
994
// Backported from chanmon_fail_consistency fuzz tests as this used to be broken.
995
995
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
996
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
996
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
997
997
998
998
let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
999
999
let ( payment_preimage_1, payment_hash_1) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -1106,7 +1106,7 @@ fn claim_while_disconnected_monitor_update_fail() {
1106
1106
// code introduced a regression in this test (specifically, this caught a removal of the
1107
1107
// channel_reestablish handling ensuring the order was sensical given the messages used).
1108
1108
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1109
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1109
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1110
1110
1111
1111
// Forward a payment for B to claim
1112
1112
let ( payment_preimage_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
@@ -1221,7 +1221,7 @@ fn monitor_failed_no_reestablish_response() {
1221
1221
// Backported from chanmon_fail_consistency fuzz tests as it caught a long-standing
1222
1222
// debug_assert!() failure in channel_reestablish handling.
1223
1223
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1224
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1224
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1225
1225
1226
1226
// Route the payment and deliver the initial commitment_signed (with a monitor update failure
1227
1227
// on receipt).
@@ -1287,7 +1287,7 @@ fn first_message_on_recv_ordering() {
1287
1287
// payment applied).
1288
1288
// Backported from chanmon_fail_consistency fuzz tests as it caught a bug here.
1289
1289
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1290
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1290
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1291
1291
1292
1292
// Route the first payment outbound, holding the last RAA for B until we are set up so that we
1293
1293
// can deliver it and fail the monitor update.
@@ -1372,8 +1372,8 @@ fn test_monitor_update_fail_claim() {
1372
1372
// payment from B to A fail due to the paused channel. Finally, we restore the channel monitor
1373
1373
// updating and claim the payment on B.
1374
1374
let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
1375
- let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1376
- create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1375
+ let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1376
+ create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1377
1377
1378
1378
// Rebalance a bit so that we can send backwards from 3 to 2.
1379
1379
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 , 5_000_000 ) ;
@@ -1445,8 +1445,8 @@ fn test_monitor_update_on_pending_forwards() {
1445
1445
// The payment from A to C will be failed by C and pending a back-fail to A, while the payment
1446
1446
// from C to A will be pending a forward to A.
1447
1447
let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
1448
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1449
- create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1448
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1449
+ create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1450
1450
1451
1451
// Rebalance a bit so that we can send backwards from 3 to 1.
1452
1452
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 , 5_000_000 ) ;
@@ -1510,7 +1510,7 @@ fn monitor_update_claim_fail_no_response() {
1510
1510
// Backported from chanmon_fail_consistency fuzz tests as an unmerged version of the handling
1511
1511
// code was broken.
1512
1512
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1513
- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1513
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1514
1514
1515
1515
// Forward a payment for B to claim
1516
1516
let ( payment_preimage_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
@@ -1571,8 +1571,8 @@ fn do_during_funding_monitor_fail(fail_on_generate: bool, restore_between_fails:
1571
1571
let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1572
1572
1573
1573
nodes[ 0 ] . node . create_channel ( nodes[ 1 ] . node . get_our_node_id ( ) , 100000 , 10001 , 43 ) . unwrap ( ) ;
1574
- nodes[ 1 ] . node . handle_open_channel ( & nodes[ 0 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: new ( ) , & get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendOpenChannel , nodes[ 1 ] . node. get_our_node_id( ) ) ) ;
1575
- nodes[ 0 ] . node . handle_accept_channel ( & nodes[ 1 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: new ( ) , & get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendAcceptChannel , nodes[ 0 ] . node. get_our_node_id( ) ) ) ;
1574
+ nodes[ 1 ] . node . handle_open_channel ( & nodes[ 0 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: supported ( ) , & get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendOpenChannel , nodes[ 1 ] . node. get_our_node_id( ) ) ) ;
1575
+ nodes[ 0 ] . node . handle_accept_channel ( & nodes[ 1 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: supported ( ) , & get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendAcceptChannel , nodes[ 0 ] . node. get_our_node_id( ) ) ) ;
1576
1576
1577
1577
let ( temporary_channel_id, funding_tx, funding_output) = create_funding_transaction ( & nodes[ 0 ] , 100000 , 43 ) ;
1578
1578
0 commit comments