diff options
| author | John Newbery <[email protected]> | 2020-07-10 16:48:20 +0100 |
|---|---|---|
| committer | John Newbery <[email protected]> | 2020-07-10 22:14:18 +0100 |
| commit | 37a934e6b35bea2125732d2c074998d9fe70633e (patch) | |
| tree | 6e2b3c030b01fddfbfbc8db8e94c2d1a805953aa /src | |
| parent | Merge #14033: p2p: Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VER... (diff) | |
| download | discoin-37a934e6b35bea2125732d2c074998d9fe70633e.tar.xz discoin-37a934e6b35bea2125732d2c074998d9fe70633e.zip | |
[protocol] Remove unused CADDR_TIME_VERSION
Add comments to CAddress serialization code explaining why
it's no longer needed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/protocol.h | 8 | ||||
| -rw-r--r-- | src/version.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/protocol.h b/src/protocol.h index 985f44640..9ab63a30f 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)); diff --git a/src/version.h b/src/version.h index d932b512d..d2a747fab 100644 --- a/src/version.h +++ b/src/version.h @@ -20,10 +20,6 @@ static const int GETHEADERS_VERSION = 31800; //! disconnect from peers older than this proto version static const int MIN_PEER_PROTO_VERSION = GETHEADERS_VERSION; -//! nTime field added to CAddress, starting with this version; -//! if possible, avoid requesting addresses nodes older than this -static const int CADDR_TIME_VERSION = 31402; - //! BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; |