mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-18 11:01:06 +00:00
Merge pull request #5134
6261e6e getblockhash: throw JSONRPCError (not runtime_error) (dexX7)
This commit is contained in:
commit
2ffdf21ce3
@ -225,7 +225,7 @@ Value getblockhash(const Array& params, bool fHelp)
|
|||||||
|
|
||||||
int nHeight = params[0].get_int();
|
int nHeight = params[0].get_int();
|
||||||
if (nHeight < 0 || nHeight > chainActive.Height())
|
if (nHeight < 0 || nHeight > chainActive.Height())
|
||||||
throw runtime_error("Block number out of range.");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
|
||||||
|
|
||||||
CBlockIndex* pblockindex = chainActive[nHeight];
|
CBlockIndex* pblockindex = chainActive[nHeight];
|
||||||
return pblockindex->GetBlockHash().GetHex();
|
return pblockindex->GetBlockHash().GetHex();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user