mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 04:32:20 +02:00
Avoid a segfault on getblock if it can't read a block from disk.
This commit is contained in:
@ -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)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user