From 9f20e7a2e87f46a824476ebf89957526eec6ec37 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 00:17:36 +0100 Subject: [PATCH] feat(daemon): add getblockcount RPC, fix method routing Co-Authored-By: Charon --- daemon/server.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/daemon/server.go b/daemon/server.go index 662479b..5bcf666 100644 --- a/daemon/server.go +++ b/daemon/server.go @@ -90,6 +90,8 @@ func (s *Server) handleJSONRPC(w http.ResponseWriter, r *http.Request) { s.rpcGetAllAliasDetails(w, req) case "get_alias_details": s.rpcGetAliasDetails(w, req) + case "getblockcount": + s.rpcGetBlockCount(w, req) default: writeError(w, req.ID, -32601, core.Sprintf("method %s not found", req.Method)) } @@ -263,3 +265,11 @@ func (s *Server) rpcGetAliasCount(w http.ResponseWriter, req jsonRPCRequest) { "status": "OK", }) } + +func (s *Server) rpcGetBlockCount(w http.ResponseWriter, req jsonRPCRequest) { + height, _ := s.chain.Height() + writeResult(w, req.ID, map[string]interface{}{ + "count": height, + "status": "OK", + }) +}