mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
pytest: Yet another instance where we wait only on one side
Waiting on one end and then just asserting on the other is racy. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
f1c64db5e7
commit
1a9c7783b7
@@ -1584,10 +1584,14 @@ class LightningDTests(BaseLightningDTests):
|
||||
['ONCHAIN:Tracking their unilateral close',
|
||||
'ONCHAIN:All outputs resolved: waiting 99 more blocks before forgetting channel'])
|
||||
|
||||
billboard = l2.rpc.listpeers(l1.info['id'])['peers'][0]['channels'][0]['status']
|
||||
assert len(billboard) == 2
|
||||
assert billboard[0] == 'ONCHAIN:Tracking our own unilateral close'
|
||||
assert re.fullmatch('ONCHAIN:.* outputs unresolved: in 4 blocks will spend DELAYED_OUTPUT_TO_US \(.*:0\) using OUR_DELAYED_RETURN_TO_WALLET', billboard[1])
|
||||
def check_billboard():
|
||||
billboard = l2.rpc.listpeers(l1.info['id'])['peers'][0]['channels'][0]['status']
|
||||
return (
|
||||
len(billboard) == 2 and
|
||||
billboard[0] == 'ONCHAIN:Tracking our own unilateral close' and
|
||||
re.fullmatch('ONCHAIN:.* outputs unresolved: in 4 blocks will spend DELAYED_OUTPUT_TO_US \(.*:0\) using OUR_DELAYED_RETURN_TO_WALLET', billboard[1])
|
||||
)
|
||||
wait_for(check_billboard)
|
||||
|
||||
# Now, mine 4 blocks so it sends out the spending tx.
|
||||
bitcoind.generate_block(4)
|
||||
|
||||
Reference in New Issue
Block a user