reorder txns newest on top; show confirmations tooltip
This commit is contained in:
@@ -131,6 +131,34 @@ def list_transactions():
|
||||
return jsonify({"error": str(exc)}), 500
|
||||
|
||||
|
||||
@app.route("/api/network", methods=["GET"])
|
||||
@require_token
|
||||
def get_network_info():
|
||||
try:
|
||||
network_info = rpc_call("getnetworkinfo")
|
||||
peer_info = rpc_call("getpeerinfo")
|
||||
mempool = rpc_call("getrawmempool")
|
||||
blockchain_info = rpc_call("getblockchaininfo")
|
||||
|
||||
return jsonify({
|
||||
"network": {
|
||||
"connections": network_info.get("connections", 0),
|
||||
"networkactive": network_info.get("networkactive", False),
|
||||
"relayfee": network_info.get("relayfee", 0),
|
||||
},
|
||||
"peers": len(peer_info),
|
||||
"mempool_size": len(mempool),
|
||||
"blockchain": {
|
||||
"blocks": blockchain_info.get("blocks", 0),
|
||||
"headers": blockchain_info.get("headers", 0),
|
||||
"difficulty": blockchain_info.get("difficulty", 0),
|
||||
"chain": blockchain_info.get("chain", "unknown"),
|
||||
}
|
||||
})
|
||||
except RuntimeError as exc:
|
||||
return jsonify({"error": str(exc)}), 500
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def root():
|
||||
return send_from_directory(app.static_folder, "index.html")
|
||||
|
||||
Reference in New Issue
Block a user