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:
Rusty Russell
2018-09-19 13:36:07 +09:30
committed by Christian Decker
parent 7744c41521
commit 252bbe1d2d
4 changed files with 24 additions and 20 deletions

View File

@@ -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)