Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: XaiZou on August 12, 2015, 09:46:16 AM



Title: clean the orphan blocks from the blockchain ?
Post by: XaiZou on August 12, 2015, 09:46:16 AM
Hi,

Is there a way to remove/clean the orphan blocks from the blockchain ?

is that going to reduce the total size (GB) of the blockchain ?


Thanks


Title: Re: clean the orphan blocks from the blockchain ?
Post by: Kazimir on August 12, 2015, 10:47:36 AM
There are no orphan blocks in the blockchain.

The fact that a block is not in the blockchain (because another block ended up being part of a longer chain) is essentially what makes a block orphaned.


Title: Re: clean the orphan blocks from the blockchain ?
Post by: XaiZou on August 12, 2015, 10:56:50 AM
There are no orphan blocks in the blockchain.

The fact that a block is not in the blockchain (because another block ended up being part of a longer chain) is essentially what makes a block orphaned.

Thanks for the info, what do you think about this ?

i used a blockchain parser :

Building complete block-chain.
Found 369,344 blocks and skipped 40 orphan blocks.
Finished scanning block headers. Built block-chain with 369344 blocks found..


Title: Re: clean the orphan blocks from the blockchain ?
Post by: Kazimir on August 12, 2015, 12:22:48 PM
I guess they are leftover orphaned blocks that still reside in some nodes' mempools. They will be discarded eventually.


Title: Re: clean the orphan blocks from the blockchain ?
Post by: DannyHamilton on August 12, 2015, 12:30:55 PM
I guess they are leftover orphaned blocks that still reside in some nodes' mempools.

No, they aren't. Full nodes store the orphaned blocks on disk along with the rest of the blockchain.  They do not reside in the mempool.

They will be discarded eventually.

No, they won't.

Full nodes keep a copy of the orphaned blocks that they are aware of.

You can reinstall your node and let it resynchronize with the network if you want to clean out the orphan blocks that it is storing, but as has been pointed out, there really aren't very many of them, and they aren't taking up much space.  You'll go through all that effort and free up maybe 20 MB of space?  Why bother?


Title: Re: clean the orphan blocks from the blockchain ?
Post by: XaiZou on August 12, 2015, 07:59:51 PM
I guess they are leftover orphaned blocks that still reside in some nodes' mempools.

No, they aren't. Full nodes store the orphaned blocks on disk along with the rest of the blockchain.  They do not reside in the mempool.

They will be discarded eventually.

No, they won't.

Full nodes keep a copy of the orphaned blocks that they are aware of.

You can reinstall your node and let it resynchronize with the network if you want to clean out the orphan blocks that it is storing, but as has been pointed out, there really aren't very many of them, and they aren't taking up much space.  You'll go through all that effort and free up maybe 20 MB of space?  Why bother?

oh well, thanks for the info, i though maybe lots of orphans are there like 5+ GB or more.


Title: Re: clean the orphan blocks from the blockchain ?
Post by: amaclin on August 13, 2015, 07:51:24 AM
Found 369,344 blocks and skipped 40 orphan blocks.
No significant reasons waste time to save 40- megabytes.

You can do the following:
1) copy blk*.dat bootstrap.dat (concatenate in right order to one file)
2) backup wallet.dat and remove all files from datadir
3) rebuild datadir with bootstrap.dat