<p>1024.</p>

<pre><code>/** Size of the "block download window": how far ahead of our current height do we fetch?
 *  Larger windows tolerate larger download speed differences between peer, but increase the potential
 *  degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning
 *  harder). We'll probably want to make this a per-peer adaptive value at some point. */
static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;
</code></pre>

<p>(<a href="https://github.com/bitcoin/bitcoin/search?utf8=%E2%9C%93&amp;q=BLOCK_DOWNLOAD_WINDOW" rel="nofollow noreferrer">Source.</a>)</p>

CC BY-SA 3.0
2015-11-26T23:49:09.643Z
Warning: Before depending on this value, remember that this constant might change in future versions or may even have been changed in the source code by the user itself.
Jannes
CC BY-SA 3.0
2015-11-26T22:12:54.320Z
2017-01-09T18:05:34.783Z
2017-01-09T18:05:34.783Z
Nick ODell
<p>To be more exact: Given two blocks A and B, with heights A &lt; B, but with positions in the blk file (we'll call them pA and pB) pA > pB.</p>

<p>What is the maximum amount of blocks that there could be stored in a blk*.dat file, between pB and pA?</p>

<p>For instance, let's say this is a blk*.dat file:</p>

<p>C D <strong>B</strong> E F G <strong>A</strong> H I</p>

<p>We can see here that block A is stored 3 blocks later than B, despite A having a lower height than B. Is there a maximum amount for this value (which in this case is 3)?</p>

<blockchain><raw-data>
How much out of order are the blocks stored in the blk*.dat files?
Fernando Tiberti
# How much out of order are the blocks stored in the blk*.dat files?

(Asked by: username_0 on 2015-11-26)

To be more exact: Given two blocks A and B, with heights A < B, but with positions in the blk file (we'll call them pA and pB) pA > pB.

What is the maximum amount of blocks that there could be stored in a blk\*.dat file, between pB and pA?

For instance, let's say this is a blk\*.dat file:

C D **B** E F G **A** H I

We can see here that block A is stored 3 blocks later than B, despite A having a lower height than B. Is there a maximum amount for this value (which in this case is 3)?

**Tags:** blockchain, raw-data


---

## 1 answers

### Answer by username_1 on 2015-11-26. Score: 6 | Accepted answer

1024.

```
/** Size of the "block download window": how far ahead of our current height do we fetch?
 *  Larger windows tolerate larger download speed differences between peer, but increase the potential
 *  degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning
 *  harder). We'll probably want to make this a per-peer adaptive value at some point. */
static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;

```

([Source.](https://github.com/bitcoin/bitcoin/search?utf8=%E2%9C%93&q=BLOCK_DOWNLOAD_WINDOW))

> **Comments:**
> **username_2**: Warning: Before depending on this value, remember that this constant might change in future versions or may even have been changed in the source code by the user itself.  

---

