message: fuzz: Check for addrv1 compatibility before using addrv1 serializer
diff: #include <key.h>
  #include <merkleblock.h>
  #include <net.h>
  +#include <netbase.h>
  #include <node/utxo_snapshot.h>
  #include <primitives/block.h>
  #include <protocol.h>
  @@ -44,9 +45,9 @@ struct invalid_fuzzing_input_exception : public std::exception {
  };
  template <typename T>
  -CDataStream Serialize(const T& obj)
  +CDataStream Serialize(const T& obj, const int version = INIT_PROTO_VERSION)
  {
  - CDataStream ds(SER_NETWORK, INIT_PROTO_VERSION);
  + CDataStream ds(SER_NETWORK, version);
  ds << obj;
  return ds;
  }
  @@ -79,9 +80,9 @@ void DeserializeFromFuzzingInput(const std::vector<uint8_t>& buffer, T& obj)
  }
  template <typename T>
  -void AssertEqualAfterSerializeDeserialize(const T& obj)
  +void AssertEqualAfterSerializeDeserialize(const T& obj, const int version = INIT_PROTO_VERSION)
  {
  - assert(Deserialize<T>(Serialize(obj)) == obj);
  + assert(Deserialize<T>(Serialize(obj, version)) == obj);
  }
  } // namespace
  @@ -183,7 +184,10 @@ void test_one_input(const std::vector<uint8_t>& buffer)
  #elif NETADDR_DESERIALIZE
  CNetAddr na;
  DeserializeFromFuzzingInput(buffer, na);
  + if (na.IsAddrV1Compatible()) {
  AssertEqualAfterSerializeDeserialize(na);
  + }
  + AssertEqualAfterSerializeDeserialize(na, INIT_PROTO_VERSION | ADDRV2_FORMAT);
  #elif SERVICE_DESERIALIZE
  CService s;
  DeserializeFromFuzzingInput(buffer, s);
  