aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcryptochangements34 <bW9uZXJv@gmail.com>2018-11-02 19:31:31 -0400
committercryptochangements34 <bW9uZXJv@gmail.com>2018-11-02 19:31:31 -0400
commite61062b6f23cd27dba1da145c8590aff6fbf2f10 (patch)
tree2386ae072acda82aba83d32794133ffb6ccbf4bb /src
parentMerge pull request #4721 (diff)
downloadmonero-e61062b6f23cd27dba1da145c8590aff6fbf2f10.tar.xz
use current height - 1 for top block height in err msgs
Diffstat (limited to 'src')
-rw-r--r--src/rpc/core_rpc_server.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index aa9d3d64b..bd410047a 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1010,7 +1010,7 @@ namespace cryptonote
if(m_core.get_current_blockchain_height() <= h)
{
error_resp.code = CORE_RPC_ERROR_CODE_TOO_BIG_HEIGHT;
- error_resp.message = std::string("Too big height: ") + std::to_string(h) + ", current blockchain height = " + std::to_string(m_core.get_current_blockchain_height());
+ error_resp.message = std::string("Requested block height: ") + std::to_string(h) + " greater than current top block height: " + std::to_string(m_core.get_current_blockchain_height() - 1);
}
res = string_tools::pod_to_hex(m_core.get_block_id_by_height(h));
return true;
@@ -1457,7 +1457,7 @@ namespace cryptonote
if(m_core.get_current_blockchain_height() <= req.height)
{
error_resp.code = CORE_RPC_ERROR_CODE_TOO_BIG_HEIGHT;
- error_resp.message = std::string("Too big height: ") + std::to_string(req.height) + ", current blockchain height = " + std::to_string(m_core.get_current_blockchain_height());
+ error_resp.message = std::string("Requested block height: ") + std::to_string(req.height) + " greater than current top block height: " + std::to_string(m_core.get_current_blockchain_height() - 1);
return false;
}
crypto::hash block_hash = m_core.get_block_id_by_height(req.height);
@@ -1502,7 +1502,7 @@ namespace cryptonote
if(m_core.get_current_blockchain_height() <= req.height)
{
error_resp.code = CORE_RPC_ERROR_CODE_TOO_BIG_HEIGHT;
- error_resp.message = std::string("Too big height: ") + std::to_string(req.height) + ", current blockchain height = " + std::to_string(m_core.get_current_blockchain_height());
+ error_resp.message = std::string("Requested block height: ") + std::to_string(req.height) + " greater than current top block height: " + std::to_string(m_core.get_current_blockchain_height() - 1);
return false;
}
block_hash = m_core.get_block_id_by_height(req.height);