diff options
-rw-r--r-- | rpcblockchainexplorer/api.py | 9 | ||||
-rw-r--r-- | 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/<blockhash>") 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 %} </table> -block transactions go here +<h3>Transactions</h3> + +<ul> + {% for txid in txids %} + <li><a href="/getrawtransaction/{{ txid }}">{{ txid }}</a></li> + {% endfor %} +</ul> + {% endblock %} |