<p>You can't delete the block data themselves, but you can reset the blockchain state to a specific block by using the <code>invalidateblock</code> command. This command will mark a specific block and its descendants as invalid thus setting the chainstate to the block immediately before it. Note that this may not necessarily work to switch to a blockchain fork and may still not be able to use the forked blockchain.</p>

<p>If you want to go back to the 500,000th block, you would invalidate the 500,001st block with the call <code>invalidateblock 0000000000000000005c9959b3216f8640f94ec96edea69fe12ad7dee8b74e92</code>. By invalidating the 500,001st block the chainstate resets to height 500,000.</p>

CC BY-SA 3.0
2018-01-15T21:14:56.323Z
How do I make it go back to block 500000 with that commands? "invalidateblock 500000" ?
masterq
CC BY-SA 3.0
2018-01-15T21:29:04.497Z
You would do `invalidateblock 0000000000000000005c9959b3216f8640f94ec96edea69fe12ad7dee8b74e92`. That will invalidate the 500001st block thus setting the chainstate to the block at height 500000.
Ava Chow
CC BY-SA 4.0
2024-09-13T17:05:20.357Z
Would restarting your node with the startup options `-reindex` and `-stopatheight=500000` also work?
Murch
CC BY-SA 4.0
2018-01-15T21:06:56.573Z
2018-10-03T20:49:02.220Z
2018-10-03T20:49:02.220Z
Ava Chow
<p>I have a full node of Bitcoin Core wallet. I would like to know if it's possible to delete data after a certain block. For example Bitcoin is currently at block 504385. There was a fork around block <code>500000</code> and I would delete all block data after that so I can use the blockchain data I have with the new fork wallet.</p>

<bitcoin-core><synchronization><block-validity><reindex><invalidateblock>
Bitcoin Core - Go back to a specific block?
masterq
# Bitcoin Core - Go back to a specific block?

(Asked by: username_0 on 2018-01-15)

I have a full node of Bitcoin Core wallet. I would like to know if it's possible to delete data after a certain block. For example Bitcoin is currently at block 504385. There was a fork around block `500000` and I would delete all block data after that so I can use the blockchain data I have with the new fork wallet.

**Tags:** bitcoin-core, synchronization, block-validity, reindex, invalidateblock


---

## 1 answers

### Answer by username_1 on 2018-01-15. Score: 11 | Accepted answer

You can't delete the block data themselves, but you can reset the blockchain state to a specific block by using the `invalidateblock` command. This command will mark a specific block and its descendants as invalid thus setting the chainstate to the block immediately before it. Note that this may not necessarily work to switch to a blockchain fork and may still not be able to use the forked blockchain.

If you want to go back to the 500,000th block, you would invalidate the 500,001st block with the call `invalidateblock 0000000000000000005c9959b3216f8640f94ec96edea69fe12ad7dee8b74e92`. By invalidating the 500,001st block the chainstate resets to height 500,000.

> **Comments:**
> **username_0**: How do I make it go back to block 500000 with that commands? "invalidateblock 500000" ?  
> **username_1**: You would do `invalidateblock 0000000000000000005c9959b3216f8640f94ec96edea69fe12ad7dee8b74e92`. That will invalidate the 500001st block thus setting the chainstate to the block at height 500000.  
> **username_2**: Would restarting your node with the startup options `-reindex` and `-stopatheight=500000` also work?  

---

