Serializing cpp_dec_float_50 using a byte dump was not a good idea
because random padding in the data structure was stored on disk.
Of course, the padding was different in memory when the CBlockUndo
was serialized using the CHashWriter causing the hash to be different
than what was computed from the data serialized to disk.
This commit explicitly zeros out the padding so that the serialization
is backward compatible but also consistent.
We will want to change this serialization in the future. In the meantime
I added static asserts to make sure any change in the data structure will
cause compilation failures.
Serializing cpp_dec_float_50 using a byte dump was not a good idea because random padding in the data structure was stored on disk.
Of course, the padding was different in memory when the CBlockUndo was serialized using the CHashWriter causing the hash to be different than what was computed from the data serialized to disk.
This commit explicitly zeros out the padding so that the serialization is backward compatible but also consistent.
We will want to change this serialization in the future. In the meantime I added static asserts to make sure any change in the data structure will cause compilation failures.