diff options
-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> |