mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
test: uses wait_for_htlcs helper in test_pay
This commit is contained in:
committed by
Rusty Russell
parent
5f7cf307e7
commit
e92ab89087
@@ -2299,8 +2299,8 @@ def test_channel_drainage(node_factory, bitcoind):
|
|||||||
l1.rpc.waitsendpay(payment_hash, 10)
|
l1.rpc.waitsendpay(payment_hash, 10)
|
||||||
|
|
||||||
# wait until totally settled
|
# wait until totally settled
|
||||||
wait_for(lambda: len(l1.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0)
|
l1.wait_for_htlcs()
|
||||||
wait_for(lambda: len(l2.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0)
|
l2.wait_for_htlcs()
|
||||||
|
|
||||||
# But we can get more! By using a trimmed htlc output; this doesn't cause
|
# But we can get more! By using a trimmed htlc output; this doesn't cause
|
||||||
# an increase in tx fee, so it's allowed.
|
# an increase in tx fee, so it's allowed.
|
||||||
@@ -2311,8 +2311,8 @@ def test_channel_drainage(node_factory, bitcoind):
|
|||||||
l1.rpc.waitsendpay(payment_hash, TIMEOUT)
|
l1.rpc.waitsendpay(payment_hash, TIMEOUT)
|
||||||
|
|
||||||
# wait until totally settled
|
# wait until totally settled
|
||||||
wait_for(lambda: len(l1.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0)
|
l1.wait_for_htlcs()
|
||||||
wait_for(lambda: len(l2.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0)
|
l2.wait_for_htlcs()
|
||||||
|
|
||||||
# Now, l1 is paying fees, but it can't afford a larger tx, so any
|
# Now, l1 is paying fees, but it can't afford a larger tx, so any
|
||||||
# attempt to add an HTLC which is not trimmed will fail.
|
# attempt to add an HTLC which is not trimmed will fail.
|
||||||
|
|||||||
Reference in New Issue
Block a user