mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
refactor: add a function for determining if a block is pruned or not
This commit is contained in:
@@ -742,7 +742,7 @@ static UniValue getblockheader(const JSONRPCRequest& request)
|
||||
static CBlock GetBlockChecked(const CBlockIndex* pblockindex)
|
||||
{
|
||||
CBlock block;
|
||||
if (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0) {
|
||||
if (IsBlockPruned(pblockindex)) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Block not available (pruned data)");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user