From f8866e8c324be3322fa507c2ceb1de35d148d0f1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 26 Nov 2020 18:13:42 -0800 Subject: Add roundtrip fuzz tests for CAddress serialization --- src/protocol.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index 251b8892cf..f9248899dc 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -449,6 +449,13 @@ public: uint32_t nTime{TIME_INIT}; //! Serialized as uint64_t in V1, and as CompactSize in V2. ServiceFlags nServices{NODE_NONE}; + + friend bool operator==(const CAddress& a, const CAddress& b) + { + return a.nTime == b.nTime && + a.nServices == b.nServices && + static_cast(a) == static_cast(b); + } }; /** getdata message type flags */ -- cgit v1.2.3