Browse Source

pytest: Wait for the funding transaction to be in the mempool

This can lead to failures in the valgrind configuration.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
1b604d5dd6
  1. 4
      tests/test_lightningd.py

4
tests/test_lightningd.py

@ -288,9 +288,13 @@ class LightningDTests(BaseLightningDTests):
def fund_channel(self, l1, l2, amount):
# Generates a block, so we know next tx will be first in block.
self.give_funds(l1, amount + 1000000)
num_tx = len(l1.bitcoin.rpc.getrawmempool())
tx = l1.rpc.fundchannel(l2.info['id'], amount)['tx']
# Technically, this is async to fundchannel.
l1.daemon.wait_for_log('sendrawtx exit 0')
wait_for(lambda: len(l1.bitcoin.rpc.getrawmempool()) == num_tx + 1)
l1.bitcoin.generate_block(1)
# We wait until gossipd sees local update, as well as status NORMAL,
# so it can definitely route through.

Loading…
Cancel
Save