aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index adc2d56284..69bf5b58ac 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -174,6 +174,9 @@ static bool rest_block(AcceptedConnection* conn,
throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found");
pblockindex = mapBlockIndex[hash];
+ if (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0)
+ throw RESTERR(HTTP_NOT_FOUND, hashStr + " not available (pruned data)");
+
if (!ReadBlockFromDisk(block, pblockindex))
throw RESTERR(HTTP_NOT_FOUND, hashStr + " not found");
}