Avoid a segfault on getblock if it can't read a block from disk.

Rebased-From: 954d2e7
This commit is contained in:
Ruben Dario Ponticelli 2014-07-09 21:37:27 -03:00 committed by Wladimir J. van der Laan
parent bf75a3d3fd
commit 44d8e093ca

View File

@ -276,7 +276,9 @@ Value getblock(const Array& params, bool fHelp)
CBlock block; CBlock block;
CBlockIndex* pblockindex = mapBlockIndex[hash]; CBlockIndex* pblockindex = mapBlockIndex[hash];
ReadBlockFromDisk(block, pblockindex);
if(!ReadBlockFromDisk(block, pblockindex))
throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk");
if (!fVerbose) if (!fVerbose)
{ {