Browse Source

Merge pull request #4501

954d2e7 Avoid a segfault on getblock if it can't read a block from disk. (Ruben Dario Ponticelli)
tags/v0.15.1
Wladimir J. van der Laan 6 years ago
parent
commit
f0fc81a083
No account linked to committer's email address
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/rpcblockchain.cpp

+ 3
- 1
src/rpcblockchain.cpp 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)
{

Loading…
Cancel
Save