Looking at the source code of bitcoin core, the serialization part, I see that there's no serialization abstraction layer that accounts for a possible different endianness or different binary layouts on different machines.
This is not only for disk serialization, but also for network serialization.
If bitcoin core was used on a big-endian machine, or a machine with int
size not equal to 32-bit, it'll fail to connect to the network because all sizes will be incorrectly interpreted and values will be different.
Am I missing something or did I arrive at the correct conclusion?
htole16
and the like). For the word size, can you explain specifically what you think is wrong? That code appears, at first glance, to make proper use of theuintNN_t
types.