mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: don't wait for sendrawtx, wait for expected tx.
In particular, test_no_fee_estimate was flaky due to seeing the funding tx being sent. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
7744c41521
commit
252bbe1d2d
@@ -560,6 +560,10 @@ class LightningNode(object):
|
||||
active = [(c['short_channel_id'], c['flags']) for c in channels if c['active']]
|
||||
return (chanid, 0) in active and (chanid, 1) in active
|
||||
|
||||
def wait_for_channel_onchain(self, peerid):
|
||||
txid = only_one(only_one(self.rpc.listpeers(peerid)['peers'])['channels'])['scratch_txid']
|
||||
wait_for(lambda: txid in self.bitcoin.rpc.getrawmempool())
|
||||
|
||||
def wait_channel_active(self, chanid):
|
||||
wait_for(lambda: self.is_channel_active(chanid), interval=1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user