wait_for(lambda:l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'][0]['status']==['CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 5430 satoshi','ONCHAIND_MUTUAL:Tracking mutual close transaction','ONCHAIND_MUTUAL:All outputs resolved: waiting 99 more blocks before forgetting channel'])
l1.bitcoin.rpc.generate(9)
wait_for(lambda:l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'][0]['status']==['CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 5430 satoshi','ONCHAIND_MUTUAL:Tracking mutual close transaction','ONCHAIND_MUTUAL:All outputs resolved: waiting 90 more blocks before forgetting channel'])
# Make sure both have forgotten about it
l1.bitcoin.rpc.generate(100)
l1.bitcoin.rpc.generate(90)
wait_forget_channels(l1)
wait_forget_channels(l2)
@ -1156,8 +1170,18 @@ class LightningDTests(BaseLightningDTests):
l2.daemon.wait_for_log(' to ONCHAIND_OUR_UNILATERAL')
l2.daemon.wait_for_log('Propose handling OUR_UNILATERAL/DELAYED_OUTPUT_TO_US by OUR_DELAYED_RETURN_TO_WALLET (.*) in 5 blocks')
# Now, mine 5 blocks so it sends out the spending tx.
assertbillboard[0]=='ONCHAIND_OUR_UNILATERAL:Tracking our own unilateral close'
assertre.fullmatch('ONCHAIND_OUR_UNILATERAL:.* outputs unresolved: in 4 blocks will spend DELAYED_OUTPUT_TO_US \(.*:0\) using OUR_DELAYED_RETURN_TO_WALLET',billboard[1])
# Now, mine 4 blocks so it sends out the spending tx.
@ -1167,6 +1191,8 @@ class LightningDTests(BaseLightningDTests):
bitcoind.generate_block(95)
wait_forget_channels(l1)
wait_for(lambda:l2.rpc.listpeers(l1.info['id'])['peers'][0]['channels'][0]['status']==['ONCHAIND_OUR_UNILATERAL:Tracking our own unilateral close','ONCHAIND_OUR_UNILATERAL:All outputs resolved: waiting 5 more blocks before forgetting channel'],timeout=1)