9

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)?

1 Answers1

6

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.)

Nick ODell
  • 29,396
  • 11
  • 72
  • 130
  • 5
    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 Nov 26 '15 at 23:49