refactor: add a function for determining if a block is pruned or not

This commit is contained in:
Karl-Johan Alm
2018-05-17 16:30:00 +09:00
parent f8a29ca823
commit e9a1881b90
3 changed files with 8 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ static bool rest_block(HTTPRequest* req,
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
}
if (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0)
if (IsBlockPruned(pblockindex))
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not available (pruned data)");
if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus()))