diff options
author | Bryan Bishop <kanzure@gmail.com> | 2015-06-08 14:08:40 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2015-06-08 14:08:40 -0500 |
commit | e9bf1a21240b97edb3e4d1d5be8b21b5b6ce32d5 (patch) | |
tree | 6797505a2cda8d36ecfd9113ab61c45ebec1b0b2 | |
parent | 6635baaa9a7b45433e7d41970e551c516526ca4b (diff) | |
download | rpcblockchainexplorer-e9bf1a21240b97edb3e4d1d5be8b21b5b6ce32d5.tar.gz rpcblockchainexplorer-e9bf1a21240b97edb3e4d1d5be8b21b5b6ce32d5.zip |
link to nextblockhash
-rw-r--r-- | rpcblockchainexplorer/api.py | 8 | ||||
-rw-r--r-- | rpcblockchainexplorer/templates/block.html | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/rpcblockchainexplorer/api.py b/rpcblockchainexplorer/api.py index e828f4c..95b0dbb 100644 --- a/rpcblockchainexplorer/api.py +++ b/rpcblockchainexplorer/api.py @@ -208,7 +208,13 @@ def _getblock(blockhash): # don't display txids in the block output del block["tx"] - return render_template("block.html", block=block, txids=txids) + if "nextblockhash" in block.keys(): + nextblockhash = block["nextblockhash"] + del block["nextblockhash"] + else: + nextblockhash = None + + return render_template("block.html", block=block, txids=txids, nextblockhash=nextblockhash) @api.route("/transaction/<txid>") def _transaction(txid): diff --git a/rpcblockchainexplorer/templates/block.html b/rpcblockchainexplorer/templates/block.html index 0613237..1bebc6e 100644 --- a/rpcblockchainexplorer/templates/block.html +++ b/rpcblockchainexplorer/templates/block.html @@ -8,6 +8,12 @@ <td>{{ block[key_name] }}</td> </tr> {% endfor %} + {% if nextblockhash != None %} + <tr> + <th>nextblockhash</th> + <td><a href="/block/{{ nextblockhash }}">{{ nextblockhash }}</a></td> + </tr> + {% endif %} </table> <h3>Transactions</h3> |