mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge pull request #6058
03c5687appropriate response when trying to get a block in pruned mode (Jonas Schnelli)1b2e555add autoprune information to RPC "getblockchaininfo" (Jonas Schnelli)
This commit is contained in:
@@ -197,6 +197,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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user