mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
getblockhash: throw JSONRPCError (not runtime_error)
This commit is contained in:
parent
3552d4b859
commit
6261e6e6e0
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue