Author

Topic: Why check for pchMessageStart in blocks? (Read 92 times)

member
Activity: 324
Merit: 17
Bitflate developer
January 24, 2021, 01:32:37 AM
#3
ranochigo, thanks for the quick response and link.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
January 23, 2021, 10:36:41 PM
#2
The magic bytes are prepended at the start of the blocks on the disk and are in a sense delimiters for the blocks represented on the disk. The magic bytes are not related to the block itself but it's included with every block in the blk.dat[1]. They are not a component in the blocks itself, per se.

It doesn't mean that the magic bytes can only appear at the start of the block though, they could also appear in the middle of the blocks as some arbitrary data.

[1] https://en.bitcoin.it/wiki/Block#Block_structure
member
Activity: 324
Merit: 17
Bitflate developer
January 23, 2021, 08:36:06 PM
#1
I notice there's a check for message_start in the function ReadRawBlockFromDisk.

https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp#L1207

If I understand correctly, message_start is used to identify Bitcoin Core clients.

https://bitcointalksearch.org/topic/pchmessagestart-what-is-for-in-bc-08-2997687

Why does the function ReadRawBlockFromDisk check for message_start? Does that mean message_start is also written into blocks?

Thanks.
Jump to: