From f67d5a00077912dadfaeb825cf9367c9e4ffdd06 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Mon, 8 Jun 2015 11:54:17 -0500 Subject: display transactions in each block --- rpcblockchainexplorer/api.py | 9 ++++++++- rpcblockchainexplorer/templates/block.html | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/rpcblockchainexplorer/api.py b/rpcblockchainexplorer/api.py index c83ffc2..aedfe83 100644 --- a/rpcblockchainexplorer/api.py +++ b/rpcblockchainexplorer/api.py @@ -198,7 +198,14 @@ def index(): @api.route("/block/") def _getblock(blockhash): block = g.bitcoin_rpc_client._call("getblock", blockhash) - return render_template("block.html", block=block) + + # store txids to be listed separately + txids = block["tx"] + + # don't display txids in the block output + del block["tx"] + + return render_template("block.html", block=block, txids=txids) @api.route("/getblockcount") def _getblockcount(): diff --git a/rpcblockchainexplorer/templates/block.html b/rpcblockchainexplorer/templates/block.html index 4d48f38..06cec4a 100644 --- a/rpcblockchainexplorer/templates/block.html +++ b/rpcblockchainexplorer/templates/block.html @@ -10,5 +10,12 @@ {% endfor %} -block transactions go here +

Transactions

+ + + {% endblock %} -- cgit v1.2.3