Introduce new V4 format addrman

92617b7a75 effectively changed the
on-disk format in an incompatible way: old deserializers cannot
deal with multiple entries for the same IP.

Introduce a V4_MULTIPORT format, and increment the compatibility base,
so that old versions correctly recognize it as an incompatible future
version.
This commit is contained in:
Pieter Wuille
2021-10-25 11:09:30 -04:00
parent 22a9018649
commit d891ae7681
3 changed files with 5 additions and 4 deletions

View File

@@ -171,7 +171,7 @@ void AddrManImpl::Serialize(Stream& s_) const
// Increment `lowest_compatible` iff a newly introduced format is incompatible with
// the previous one.
static constexpr uint8_t lowest_compatible = Format::V3_BIP155;
static constexpr uint8_t lowest_compatible = Format::V4_MULTIPORT;
s << static_cast<uint8_t>(INCOMPATIBILITY_BASE + lowest_compatible);
s << nKey;