Prune configuration doesn't work during import

Fix pruning functionality during -reindex or -loadblock, which are mechanisms that allow rebuilding chainstate without redownloading blocks.
Checked Out
$3,750.00
Check Out Task
Task Bounty Details

23852

Bitcoin Issue

Days

Estimated Effort

Checked Out

Current Status

$3,750.00

Paid in USD or equivalent BTC upon acceptance

Bitcoin Issue

Pruning is a process by which a bitcoin node can limit the amount of disk space it consumes by discarding block files that have been validated and are buried by a certain amount of chain work.

Reindexing is the process of rebuilding chainstate using block data that already resides on disk.

From the original issue:

It appears that -prune is ignored during import (-reindex, or -loadblock).

For example starting with an empty datadir, prune=80000, and all block files passed in via -loadblock [doesn't result in pruning occurring.]

Prerequisite Skills

C++

Code Guidelines

Repository Code Guidelines Page

Definition of Done

Get a PR merged that closes the issue

Check Out Task