aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-07-10 16:48:20 +0100
committerJohn Newbery <john@johnnewbery.com>2020-07-10 22:14:18 +0100
commit37a934e6b35bea2125732d2c074998d9fe70633e (patch)
tree6e2b3c030b01fddfbfbc8db8e94c2d1a805953aa /src/protocol.h
parentc0b0b0240f986b88a31336db2e6906de0edc0816 (diff)
downloadbitcoin-37a934e6b35bea2125732d2c074998d9fe70633e.tar.xz
[protocol] Remove unused CADDR_TIME_VERSION
Add comments to CAddress serialization code explaining why it's no longer needed.
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/protocol.h b/src/protocol.h
index 985f44640b..9ab63a30fb 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -371,7 +371,13 @@ public:
READWRITE(nVersion);
}
if ((s.GetType() & SER_DISK) ||
- (nVersion >= CADDR_TIME_VERSION && !(s.GetType() & SER_GETHASH))) {
+ (nVersion != INIT_PROTO_VERSION && !(s.GetType() & SER_GETHASH))) {
+ // The only time we serialize a CAddress object without nTime is in
+ // the initial VERSION messages which contain two CAddress records.
+ // At that point, the serialization version is INIT_PROTO_VERSION.
+ // After the version handshake, serialization version is >=
+ // MIN_PEER_PROTO_VERSION and all ADDR messages are serialized with
+ // nTime.
READWRITE(obj.nTime);
}
READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));