From e92e7148e2058c0e571b53e3096f4507ccd93470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sa=C5=82aban?= Date: Fri, 25 Oct 2019 22:34:06 +0200 Subject: [PATCH] Add mempool status to daemoninfo.py --- utils/daemoninfo.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/daemoninfo.py b/utils/daemoninfo.py index 66c11f8..f4c3703 100755 --- a/utils/daemoninfo.py +++ b/utils/daemoninfo.py @@ -44,3 +44,10 @@ for hdr in reversed(d.headers(info['height']-6, info['height']-1)): print("{height:10d} {hash} {block_size_kb:6.2f} kB {num_txes:3d} txn(s) " "v{major_version:d}".format( block_size_kb=hdr['block_size']/1024.0, **hdr)) +mempool = d.mempool() +if mempool: + print("\n{:d} txn(s) in mempool:".format(len(mempool))) + for tx in d.mempool(): + print("{:>10s} {:s}".format(tx.timestamp.strftime("%H:%M:%S"), tx.hash)) +else: + print("\nMempool is empty")