Browse Source
getblockhash: throw JSONRPCError (not runtime_error)
pull/145/head
dexX7
10 years ago
No known key found for this signature in database
GPG Key ID: 7675E31CF5719832
1 changed files with
1 additions and
1 deletions
-
src/rpcblockchain.cpp
|
|
@ -225,7 +225,7 @@ Value getblockhash(const Array& params, bool fHelp) |
|
|
|
|
|
|
|
int nHeight = params[0].get_int(); |
|
|
|
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]; |
|
|
|
return pblockindex->GetBlockHash().GetHex(); |
|
|
|