<p>Bitcoin will store a block on disk as soon as it has verified its proof-of-work.</p>

<p>Blocks are stored append-only in the block files, and never deleted or overwritten. You cannot judge from the block files which are considered valid, or which are considered the currently best chain - that information is kept in the block index database.</p>

CC BY-SA 3.0
2013-12-03T00:04:58.523Z
2013-12-03T00:04:58.523Z
Pieter Wuille
<p>i haven't read the source code for bitcoind, but i want to know if it downloads bad blocks which will later be rejected by the network (and presumably later removed from bitcoind's block files)?</p>

<p>i have a script which parses block files into a database and if a block is in the files at one point in time, then gets removed later then my script (as it currently stands) will end up importing the incorrect block.</p>

<p>if bitcoind does download bad blocks, how should i avoid importing these into my database? should i just wait and never import the latest, say, 5 blocks?</p>

<bitcoind>
does bitcoind download bad blocks?
mulllhausen
# does bitcoind download bad blocks?

(Asked by: username_0 on 2013-12-02)

i haven't read the source code for bitcoind, but i want to know if it downloads bad blocks which will later be rejected by the network (and presumably later removed from bitcoind's block files)?

i have a script which parses block files into a database and if a block is in the files at one point in time, then gets removed later then my script (as it currently stands) will end up importing the incorrect block.

if bitcoind does download bad blocks, how should i avoid importing these into my database? should i just wait and never import the latest, say, 5 blocks?

**Tags:** bitcoind


---

## 1 answers

### Answer by username_1 on 2013-12-03. Score: 2 | Accepted answer

Bitcoin will store a block on disk as soon as it has verified its proof-of-work.

Blocks are stored append-only in the block files, and never deleted or overwritten. You cannot judge from the block files which are considered valid, or which are considered the currently best chain - that information is kept in the block index database.


---

