aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2019-04-01 01:02:58 +0100
committerHoward Chu <hyc@symas.com>2019-04-01 01:02:58 +0100
commitc746f45d3e12027b99e4ec010fa465f0bd01f198 (patch)
tree7e148cc0ebdb78c2664aa9a6f4240ae3f4215bd1 /src/rpc/core_rpc_server.cpp
parentMerge pull request #5359 (diff)
downloadmonero-c746f45d3e12027b99e4ec010fa465f0bd01f198.tar.xz
Add hash of top block to /getheight RPC
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 56b0361a7..111b1c324 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -193,7 +193,9 @@ namespace cryptonote
if (use_bootstrap_daemon_if_necessary<COMMAND_RPC_GET_HEIGHT>(invoke_http_mode::JON, "/getheight", req, res, r))
return r;
- res.height = m_core.get_current_blockchain_height();
+ crypto::hash hash;
+ m_core.get_blockchain_top(res.height, hash);
+ res.hash = string_tools::pod_to_hex(hash);
res.status = CORE_RPC_STATUS_OK;
return true;
}