From 6261e6e6e0ae9860d322efe0f11d0960b300dad4 Mon Sep 17 00:00:00 2001 From: dexX7 Date: Fri, 24 Oct 2014 15:43:40 +0200 Subject: [PATCH] getblockhash: throw JSONRPCError (not runtime_error) --- src/rpcblockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5beac0512ab..02b510aa41d 100644 --- a/src/rpcblockchain.cpp +++ b/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();