Merge pull request #681 from rnicoll/1.8.1-dev-getblock-segfault

"getblock" RPC call now handles load failure
This commit is contained in:
langerhans 2014-08-30 16:18:43 +02:00
commit 26f8bc3d2b

View File

@ -312,7 +312,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)
{