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.
This commit is contained in:
Christian Decker 2020-12-18 12:28:12 +01:00
parent 6af8adde26
commit 8b09ac38aa
1 changed files with 8 additions and 0 deletions

View File

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