diff options
author | Bryan Bishop <kanzure@gmail.com> | 2015-06-08 14:00:58 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2015-06-08 14:00:58 -0500 |
commit | 6f0bdf3634ddbf5ae5289f4e6aa86430bd80f9d2 (patch) | |
tree | 47c19a751dde250b6c082754bed8754e72d81fe1 | |
parent | a5fac6449e2423b1dd97baf0f1407840c4626663 (diff) | |
download | rpcblockchainexplorer-6f0bdf3634ddbf5ae5289f4e6aa86430bd80f9d2.tar.gz rpcblockchainexplorer-6f0bdf3634ddbf5ae5289f4e6aa86430bd80f9d2.zip |
display transaction details
-rw-r--r-- | rpcblockchainexplorer/api.py | 7 | ||||
-rw-r--r-- | rpcblockchainexplorer/templates/transaction.html | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/rpcblockchainexplorer/api.py b/rpcblockchainexplorer/api.py index aedfe83..d759e04 100644 --- a/rpcblockchainexplorer/api.py +++ b/rpcblockchainexplorer/api.py @@ -207,6 +207,13 @@ def _getblock(blockhash): return render_template("block.html", block=block, txids=txids) +@api.route("/transaction/<txid>") +def _transaction(txid): + transaction = g.bitcoin_rpc_client._call("getrawtransaction", b2x(x(txid)), 1) + blockhash = transaction["blockhash"] + del transaction["blockhash"] + return render_template("transaction.html", transaction=transaction, blockhash=blockhash) + @api.route("/getblockcount") def _getblockcount(): blockcount = g.bitcoin_rpc_client.getblockcount() diff --git a/rpcblockchainexplorer/templates/transaction.html b/rpcblockchainexplorer/templates/transaction.html index 2cd67c8..dde57ed 100644 --- a/rpcblockchainexplorer/templates/transaction.html +++ b/rpcblockchainexplorer/templates/transaction.html @@ -2,6 +2,10 @@ {% block content %} <table> + <tr> + <th>block</th> + <td><a href="/block/{{ blockhash }}">{{ blockhash }}</a></td> + </tr> {% for key_name in transaction.keys() %} <tr> <th>{{ key_name }}</th> |