HomePhabricator

[backport#15991] Bugfix: fix pruneblockchain returned prune height

Description

[backport#15991] Bugfix: fix pruneblockchain returned prune height

Summary:
fixup: Fix prunning test (João Barbosa)
Fix RPC/pruneblockchain returned prune height (Jonas Schnelli)

Pull request description:

The help of `pruneblockchain` tells us that the return value is `Height of the last block pruned.`,... but the implementation naively returns the provided input `height` and therefore not respecting that pruning can't be done on all possible blockheight due to the fact that we only prune complete blockfiles (which combine multiple blocks).

This fixes the return value to actually return the correct prune height.

Backport of Core PR15991

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7389

Details

Provenance
Jonas Schnelli <dev@jonasschnelli.ch>Authored on Jun 13 2019, 11:34
majcostaCommitted on Sep 8 2020, 14:00
majcostaPushed on Sep 8 2020, 14:00
Reviewer
Restricted Project
Differential Revision
D7389: [backport#15991] Bugfix: fix pruneblockchain returned prune height
Parents
rABCdcc5070fc162: [backport#17316] refactor: Replace all uses of boost::optional with our own…
Branches
Unknown
Tags
Unknown