@@ -216,9 +216,9 @@ def test_closing_torture(node_factory, executor, bitcoind):
216
216
def test_closing_different_fees (node_factory , bitcoind , executor ):
217
217
l1 = node_factory .get_node ()
218
218
219
- # Default feerate = 15000/7500/1000
219
+ # Default feerate = 15000/11000/ 7500/1000
220
220
# It will start at the second number, accepting anything above the first.
221
- feerates = [[20000 , 15000 , 7400 ], [8000 , 1001 , 100 ]]
221
+ feerates = [[20000 , 11000 , 15000 , 7400 ], [8000 , 6000 , 1001 , 100 ]]
222
222
amounts = [0 , 545999 , 546000 ]
223
223
num_peers = len (feerates ) * len (amounts )
224
224
@@ -395,10 +395,10 @@ def test_deprecated_closing_compat(node_factory, bitcoind, chainparams):
395
395
396
396
def closing_fee (node_factory , bitcoind , chainparams , opts ):
397
397
rate = opts ['funder_feerate_per_kw' ]
398
- funder = node_factory .get_node (feerates = (rate , rate , rate ))
398
+ funder = node_factory .get_node (feerates = (rate , rate , rate , rate ))
399
399
400
400
rate = opts ['fundee_feerate_per_kw' ]
401
- fundee = node_factory .get_node (feerates = (rate , rate , rate ))
401
+ fundee = node_factory .get_node (feerates = (rate , rate , rate , rate ))
402
402
403
403
funder_id = funder .info ['id' ]
404
404
fundee_id = fundee .info ['id' ]
@@ -479,7 +479,9 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams):
479
479
"""Test penalty transaction with an incoming HTLC"""
480
480
# We suppress each one after first commit; HTLC gets added not fulfilled.
481
481
# Feerates identical so we don't get gratuitous commit to update them
482
- l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED-nocommit' ], may_fail = True , feerates = (7500 , 7500 , 7500 ), allow_broken_log = True )
482
+ l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED-nocommit' ],
483
+ may_fail = True , feerates = (7500 , 7500 , 7500 , 7500 ),
484
+ allow_broken_log = True )
483
485
l2 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED-nocommit' ])
484
486
485
487
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -520,6 +522,7 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams):
520
522
bitcoind .generate_block (1 )
521
523
522
524
l2 .daemon .wait_for_log (' to ONCHAIN' )
525
+
523
526
# FIXME: l1 should try to stumble along!
524
527
wait_for (lambda : len (l2 .getactivechannels ()) == 0 )
525
528
@@ -542,7 +545,7 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams):
542
545
outputs = l2 .rpc .listfunds ()['outputs' ]
543
546
assert [o ['status' ] for o in outputs ] == ['confirmed' ] * 2
544
547
# Allow some lossage for fees.
545
- slack = 27000 if chainparams ['elements' ] else 15000
548
+ slack = 30000 if chainparams ['elements' ] else 20000
546
549
assert sum (o ['value' ] for o in outputs ) < 10 ** 6
547
550
assert sum (o ['value' ] for o in outputs ) > 10 ** 6 - slack
548
551
@@ -552,7 +555,9 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams):
552
555
"""Test penalty transaction with an outgoing HTLC"""
553
556
# First we need to get funds to l2, so suppress after second.
554
557
# Feerates identical so we don't get gratuitous commit to update them
555
- l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED*3-nocommit' ], may_fail = True , feerates = (7500 , 7500 , 7500 ), allow_broken_log = True )
558
+ l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED*3-nocommit' ],
559
+ may_fail = True , feerates = (7500 , 7500 , 7500 , 7500 ),
560
+ allow_broken_log = True )
556
561
l2 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED*3-nocommit' ])
557
562
558
563
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -622,7 +627,7 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams):
622
627
outputs = l2 .rpc .listfunds ()['outputs' ]
623
628
assert [o ['status' ] for o in outputs ] == ['confirmed' ] * 3
624
629
# Allow some lossage for fees.
625
- slack = 27000 if chainparams ['elements' ] else 15000
630
+ slack = 30000 if chainparams ['elements' ] else 20000
626
631
assert sum (o ['value' ] for o in outputs ) < 10 ** 6
627
632
assert sum (o ['value' ] for o in outputs ) > 10 ** 6 - slack
628
633
@@ -720,7 +725,8 @@ def test_onchaind_replay(node_factory, bitcoind):
720
725
disconnects = ['+WIRE_REVOKE_AND_ACK' , 'permfail' ]
721
726
options = {'watchtime-blocks' : 201 , 'cltv-delta' : 101 }
722
727
# Feerates identical so we don't get gratuitous commit to update them
723
- l1 = node_factory .get_node (options = options , disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
728
+ l1 = node_factory .get_node (options = options , disconnect = disconnects ,
729
+ feerates = (7500 , 7500 , 7500 , 7500 ))
724
730
l2 = node_factory .get_node (options = options )
725
731
726
732
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -773,7 +779,8 @@ def test_onchain_dust_out(node_factory, bitcoind, executor):
773
779
# HTLC 1->2, 1 fails after it's irrevocably committed
774
780
disconnects = ['@WIRE_REVOKE_AND_ACK' , 'permfail' ]
775
781
# Feerates identical so we don't get gratuitous commit to update them
776
- l1 = node_factory .get_node (disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
782
+ l1 = node_factory .get_node (disconnect = disconnects ,
783
+ feerates = (7500 , 7500 , 7500 , 7500 ))
777
784
l2 = node_factory .get_node ()
778
785
779
786
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -836,7 +843,8 @@ def test_onchain_timeout(node_factory, bitcoind, executor):
836
843
# HTLC 1->2, 1 fails just after it's irrevocably committed
837
844
disconnects = ['+WIRE_REVOKE_AND_ACK*3' , 'permfail' ]
838
845
# Feerates identical so we don't get gratuitous commit to update them
839
- l1 = node_factory .get_node (disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
846
+ l1 = node_factory .get_node (disconnect = disconnects ,
847
+ feerates = (7500 , 7500 , 7500 , 7500 ))
840
848
l2 = node_factory .get_node ()
841
849
842
850
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1071,7 +1079,8 @@ def test_onchain_all_dust(node_factory, bitcoind, executor):
1071
1079
# is generated on-the-fly, and is thus feerate sensitive.
1072
1080
disconnects = ['-WIRE_UPDATE_FAIL_HTLC' , 'permfail' ]
1073
1081
# Feerates identical so we don't get gratuitous commit to update them
1074
- l1 = node_factory .get_node (options = {'dev-no-reconnect' : None }, feerates = (7500 , 7500 , 7500 ))
1082
+ l1 = node_factory .get_node (options = {'dev-no-reconnect' : None },
1083
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1075
1084
l2 = node_factory .get_node (disconnect = disconnects )
1076
1085
1077
1086
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1093,7 +1102,7 @@ def test_onchain_all_dust(node_factory, bitcoind, executor):
1093
1102
l2 .wait_for_channel_onchain (l1 .info ['id' ])
1094
1103
1095
1104
# Make l1's fees really high (and wait for it to exceed 50000)
1096
- l1 .set_feerates ((100000 , 100000 , 100000 ))
1105
+ l1 .set_feerates ((100000 , 100000 , 100000 , 100000 ))
1097
1106
l1 .daemon .wait_for_log ('Feerate estimate for unilateral_close set to [56789][0-9]{4}' )
1098
1107
1099
1108
bitcoind .generate_block (1 )
@@ -1130,12 +1139,12 @@ def test_onchain_different_fees(node_factory, bitcoind, executor):
1130
1139
p1 = executor .submit (l1 .pay , l2 , 1000000000 )
1131
1140
l1 .daemon .wait_for_log ('htlc 0: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION' )
1132
1141
1133
- l1 .set_feerates ((16000 , 7500 , 3750 ))
1142
+ l1 .set_feerates ((16000 , 11000 , 7500 , 3750 ))
1134
1143
p2 = executor .submit (l1 .pay , l2 , 900000000 )
1135
1144
l1 .daemon .wait_for_log ('htlc 1: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION' )
1136
1145
1137
1146
# Restart with different feerate for second HTLC.
1138
- l1 .set_feerates ((5000 , 5000 , 3750 ))
1147
+ l1 .set_feerates ((5000 , 5000 , 5000 , 3750 ))
1139
1148
l1 .restart ()
1140
1149
l1 .daemon .wait_for_log ('peer_out WIRE_UPDATE_FEE' )
1141
1150
@@ -1189,7 +1198,8 @@ def test_permfail_new_commit(node_factory, bitcoind, executor):
1189
1198
# Test case where we have two possible commits: it will use new one.
1190
1199
disconnects = ['-WIRE_REVOKE_AND_ACK' , 'permfail' ]
1191
1200
# Feerates identical so we don't get gratuitous commit to update them
1192
- l1 = node_factory .get_node (options = {'dev-no-reconnect' : None }, feerates = (7500 , 7500 , 7500 ))
1201
+ l1 = node_factory .get_node (options = {'dev-no-reconnect' : None },
1202
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1193
1203
l2 = node_factory .get_node (disconnect = disconnects )
1194
1204
1195
1205
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1490,7 +1500,8 @@ def test_permfail_htlc_in(node_factory, bitcoind, executor):
1490
1500
# Test case where we fail with unsettled incoming HTLC.
1491
1501
disconnects = ['-WIRE_UPDATE_FULFILL_HTLC' , 'permfail' ]
1492
1502
# Feerates identical so we don't get gratuitous commit to update them
1493
- l1 = node_factory .get_node (options = {'dev-no-reconnect' : None }, feerates = (7500 , 7500 , 7500 ))
1503
+ l1 = node_factory .get_node (options = {'dev-no-reconnect' : None },
1504
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1494
1505
l2 = node_factory .get_node (disconnect = disconnects )
1495
1506
1496
1507
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1536,7 +1547,8 @@ def test_permfail_htlc_out(node_factory, bitcoind, executor):
1536
1547
disconnects = ['+WIRE_REVOKE_AND_ACK' , 'permfail' ]
1537
1548
l1 = node_factory .get_node (options = {'dev-no-reconnect' : None })
1538
1549
# Feerates identical so we don't get gratuitous commit to update them
1539
- l2 = node_factory .get_node (disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
1550
+ l2 = node_factory .get_node (disconnect = disconnects ,
1551
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1540
1552
1541
1553
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
1542
1554
l2 .daemon .wait_for_log ('openingd-chan#1: Handed peer, entering loop' .format (l1 .info ['id' ]))
0 commit comments