Browse Source

Merge pull request #5134

6261e6e getblockhash: throw JSONRPCError (not runtime_error) (dexX7)
pull/1/head
Wladimir J. van der Laan 8 years ago
parent
commit
2ffdf21ce3
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      src/rpcblockchain.cpp

2
src/rpcblockchain.cpp

@ -225,7 +225,7 @@ Value getblockhash(const Array& params, bool fHelp) @@ -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();

Loading…
Cancel
Save