Skip to content

Commit

Permalink
Fix RPC/pruneblockchain returned prune height
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#15991
Rebased-From: 97f517d
  • Loading branch information
jonasschnelli authored and MarcoFalke committed Jun 14, 2019
1 parent b239824 commit c80a498
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,12 @@ static UniValue pruneblockchain(const JSONRPCRequest& request)
}

PruneBlockFilesManual(height);
return uint64_t(height);
const CBlockIndex* block = ::chainActive.Tip();
assert(block);
while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) {
block = block->pprev;
}
return uint64_t(block->nHeight);
}

static UniValue gettxoutsetinfo(const JSONRPCRequest& request)
Expand Down

0 comments on commit c80a498

Please sign in to comment.