From 03c56872b532d111645f83f4cb80c36a3e46d54f Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 27 Apr 2015 05:18:24 +0200 Subject: appropriate response when trying to get a block in pruned mode --- src/rest.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rest.cpp') diff --git a/src/rest.cpp b/src/rest.cpp index adc2d5628..69bf5b58a 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"); } -- cgit v1.2.3