Browse Source

pyln: Log mempool when we generate blocks in BitcoinD fixture

We sometimes have very specific sequences of tx broadcasts and blocks
being generated to confirm them. If the confirmation is missed the
test can completely get out of sync. Make debugging this easier by
logging what we confirmed.
ppa
Christian Decker 4 years ago
parent
commit
8b09ac38aa
  1. 8
      contrib/pyln-testing/pyln/testing/utils.py

8
contrib/pyln-testing/pyln/testing/utils.py

@ -401,6 +401,14 @@ class BitcoinD(TailableProc):
wait_for(lambda: all(txid in self.rpc.getrawmempool() for txid in wait_for_mempool))
else:
wait_for(lambda: len(self.rpc.getrawmempool()) >= wait_for_mempool)
mempool = self.rpc.getrawmempool()
logging.debug("Generating {numblocks}, confirming {lenmempool} transactions: {mempool}".format(
numblocks=numblocks,
mempool=mempool,
lenmempool=len(mempool),
))
# As of 0.16, generate() is removed; use generatetoaddress.
return self.rpc.generatetoaddress(numblocks, self.rpc.getnewaddress())

Loading…
Cancel
Save