From e9a1881b90704c6708cfba79d2208debbd4476d0 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Thu, 17 May 2018 16:30:00 +0900 Subject: refactor: add a function for determining if a block is pruned or not --- src/rest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rest.cpp') diff --git a/src/rest.cpp b/src/rest.cpp index ffa75c241f..a5f164497d 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -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())) -- cgit v1.2.3