Skip to content

Commit 97f517d

Browse files
committed
Fix RPC/pruneblockchain returned prune height
1 parent 8a503a6 commit 97f517d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,12 @@ static UniValue pruneblockchain(const JSONRPCRequest& request)
10611061
}
10621062

10631063
PruneBlockFilesManual(height);
1064-
return uint64_t(height);
1064+
const CBlockIndex* block = ::ChainActive().Tip();
1065+
assert(block);
1066+
while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) {
1067+
block = block->pprev;
1068+
}
1069+
return uint64_t(block->nHeight);
10651070
}
10661071

10671072
static UniValue gettxoutsetinfo(const JSONRPCRequest& request)

0 commit comments

Comments
 (0)