I see, that makes sense. Reading in 128 byte segments would be very slow, I don't know what I was thinking. 😅

I found another clue:

/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */

static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB

/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */

static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB

/** The maximum size of a blk?????.dat file (since 0.8) */

static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB

It should be closer to the real answer I hope. It's indeed fun to find out the internals of such program like bitcoind.

Reply to this note

Please Login to reply.

Discussion

No replies yet.