aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-11-26 18:13:42 -0800
committerPieter Wuille <pieter@wuille.net>2021-05-24 18:06:35 -0700
commitf8866e8c324be3322fa507c2ceb1de35d148d0f1 (patch)
tree577779ec6abb8acafa18bc3d111d49b094315cdb /src/protocol.h
parente2f0548b52a4b2ba3edf77e3f21365f1e8f270a4 (diff)
downloadbitcoin-f8866e8c324be3322fa507c2ceb1de35d148d0f1.tar.xz
Add roundtrip fuzz tests for CAddress serialization
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h7
1 files changed, 7 insertions, 0 deletions
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<const CService&>(a) == static_cast<const CService&>(b);
+ }
};
/** getdata message type flags */