This is also a much simpler replacement for #28327.
There are version fields in CBlockLocator
and CDiskBlockIndex
that have always been written but discarded when read.
I intended to convert them to use SerParams as introduced by #25284, which ended up looking like this. However because we don’t currently have any definition of what a hash value would mean for either one of those, and we’ve never assigned the version field any meaning, I think it’s better to just not worry about them.
If we ever need to assign meaning in the future, we can introduce SerParams
as was done for CAddress
.
As for the dummy values chosen:
CDiskBlockIndex::DUMMY_VERSION
was easy as the highest ever client version, and I don’t expect any objection there.
CBlockLocator::DUMMY_VERSION
is hard-coded to the higest PROTOCOL version ever used. This is to avoid a sudden bump that would be visible on the network if CLIENT_VERSION were used instead. In the future, if we ever need to use the value, we can discard anything in the CLIENT_VERSION range (for a few years as needed), as it’s quite a bit higher.
While reviewing, I suggest looking at the throwaway SerParams
commit above as it shows where the call-sites are. I believe that should be enough to convince one’s self that hashing is never used.