<p>Great question, Steve</p>
<p>Unfortunately it won't work. Re-starting with prune=1TB will indeed remove the stale blocks from the blocks/*.dat directory, but then re-starting again with the prune option removed will cause an error. Core will detect the switch from prune to non-pruned and require you to resync the node from scratch.</p>
<p>Next time, just write the exception for the block parser.</p>

CC BY-SA 4.0
2022-02-02T18:16:21.247Z
2022-02-03T09:59:32.520Z
2022-02-03T09:59:32.520Z
Steve
<p>I'm running a block parser that reads blocks/*.dat and I've noticed it dumps the stale blocks as well as the main chain blocks. My project only needs the main chain blocks, and I noticed that Core's pruned option removes stale blocks as part of its storage reduction.</p>
<p>So I was wondering if I restarted my node with huge a prune number (i.e. prune = 1000000), would Core remove the stale blocks while keeping all the main chain blocks. If so perhaps I could restart Core once again, with prune removed (my block parser needs pruned removed), and have what I need - a regular node with all the stale blocks removed from blocks/*.dat.</p>
<p>Basically I'm being lazy and don't want to write the exceptions for stale blocks into the block parser.</p>
<p>(Core V0.20.0 running on Mac)</p>

<bitcoin-core><pruning><stale-block>
Removing stale blocks using prune=1TB
Steve
# Removing stale blocks using prune=1TB

(Asked by: username_0 on 2022-02-02)

I'm running a block parser that reads blocks/\*.dat and I've noticed it dumps the stale blocks as well as the main chain blocks. My project only needs the main chain blocks, and I noticed that Core's pruned option removes stale blocks as part of its storage reduction.

So I was wondering if I restarted my node with huge a prune number (i.e. prune = 1000000), would Core remove the stale blocks while keeping all the main chain blocks. If so perhaps I could restart Core once again, with prune removed (my block parser needs pruned removed), and have what I need - a regular node with all the stale blocks removed from blocks/\*.dat.

Basically I'm being lazy and don't want to write the exceptions for stale blocks into the block parser.

(Core V0.20.0 running on Mac)

**Tags:** bitcoin-core, pruning, stale-block


---

## 1 answers

### Answer by username_0 on 2022-02-02. Score: 4

Great question, username_0

Unfortunately it won't work. Re-starting with prune=1TB will indeed remove the stale blocks from the blocks/\*.dat directory, but then re-starting again with the prune option removed will cause an error. Core will detect the switch from prune to non-pruned and require you to resync the node from scratch.

Next time, just write the exception for the block parser.


---

