mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
pytest: make test_mpp_adaptive more reliable
If the HTLCs are completely negotiated, we can get a channel break when we mine a pile of blocks. This is mainly seen with Postgres, due to the db speed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
d9b1e69243
commit
fc2401c1ac
1 changed files with 10 additions and 0 deletions
|
@ -3630,6 +3630,16 @@ def test_mpp_adaptive(node_factory, bitcoind):
|
|||
assert(c12['spendable_msat'].millisatoshis < amt)
|
||||
assert(c34['spendable_msat'].millisatoshis < amt)
|
||||
|
||||
# Make sure all HTLCs entirely resolved before we mine more blocks!
|
||||
def all_htlcs(n):
|
||||
htlcs = []
|
||||
for p in n.rpc.listpeers()['peers']:
|
||||
for c in p['channels']:
|
||||
htlcs += c['htlcs']
|
||||
return htlcs
|
||||
|
||||
wait_for(lambda: all([all_htlcs(n) == [] for n in [l1, l2, l3, l4]]))
|
||||
|
||||
mine_funding_to_announce(bitcoind, [l1, l2, l3, l4])
|
||||
wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 8)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue