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

This commit is contained in:
Ruben Dario Ponticelli 2014-07-09 21:37:27 -03:00
parent f3330b40a5
commit 954d2e7201
No known key found for this signature in database
GPG Key ID: 007D7A89C6DF7B2D
1 changed files with 3 additions and 1 deletions

View File

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