reorder txns newest on top; show confirmations tooltip

This commit is contained in:
Dobromir Popov
2025-09-30 01:20:40 +03:00
parent 584e2b40c5
commit b96778196c
2 changed files with 99 additions and 4 deletions

View File

@@ -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")