pytest: make sure all nodes see funds using sync_blockheight

We might have funds prior to calling join_nodes(), so testing that
we've all seen the block is better.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-08-07 12:43:55 +09:30
committed by Christian Decker
parent 7bb461acd8
commit 929fd3e2f6

View File

@@ -1094,8 +1094,8 @@ class NodeFactory(object):
bitcoind.rpc.sendtoaddress(addr, (fundamount + 1000000) / 10**8) bitcoind.rpc.sendtoaddress(addr, (fundamount + 1000000) / 10**8)
bitcoind.generate_block(1) bitcoind.generate_block(1)
sync_blockheight(bitcoind, nodes)
for src, dst in connections: for src, dst in connections:
wait_for(lambda: len(src.rpc.listfunds()['outputs']) > 0)
tx = src.rpc.fundchannel(dst.info['id'], fundamount, announce=announce_channels) tx = src.rpc.fundchannel(dst.info['id'], fundamount, announce=announce_channels)
wait_for(lambda: tx['txid'] in bitcoind.rpc.getrawmempool()) wait_for(lambda: tx['txid'] in bitcoind.rpc.getrawmempool())