in the last commit:
Could add a trailing semicolon? I’ve prepared a suggested diff for you that also switches to a switch-case so that the compiler can check all cases are covered, feel free to take or reject:
0diff --git a/src/protocol.h b/src/protocol.h
1index 500cf346e9..0f5786a1a9 100644
2--- a/src/protocol.h
3+++ b/src/protocol.h
4@@ -356,14 +356,8 @@ static inline bool MayHaveUsefulAddressDB(ServiceFlags services)
5
6 enum class AddrSerialization {
7 DISK,
8-
9- // The only time we serialize a CAddress object without nTime is in
10- // the initial VERSION messages which contain two CAddress records.
11- // At that point, the serialization version is INIT_PROTO_VERSION.
12- // After the version handshake, all ADDR messages are serialized with
13- // nTime.
14 NETWORK_NOTIME,
15- NETWORK_WITHTIME
16+ NETWORK_WITHTIME,
17 };
18
19 /** A CService with information about it as peer */
20@@ -383,13 +377,23 @@ public:
21 SERIALIZE_METHODS_PARAMS(CAddress, obj, AddrSerialization, fmt)
22 {
23 SER_READ(obj, obj.nTime = TIME_INIT);
24- if (fmt == AddrSerialization::DISK) {
25+ switch (fmt) {
26+ case AddrSerialization::DISK: {
27 uint32_t disk_version = DISK_VERSION;
28 READWRITE(disk_version);
29 READWRITE(obj.nTime);
30- } else if (fmt == AddrSerialization::NETWORK_WITHTIME) {
31+ break;
32+ }
33+ case AddrSerialization::NETWORK_WITHTIME: {
34 READWRITE(obj.nTime);
35+ break;
36+ }
37+ case AddrSerialization::NETWORK_NOTIME: {
38+ // The only time we serialize a CAddress object without nTime is in
39+ // the initial VERSION messages which contain two CAddress records.
40+ break;
41 }
42+ } // no default case, so the compiler can warn about missing cases
43 READWRITE(Using<CustomUintFormatter<8>>(obj.nServices), AsBase<CService>(obj));
44 }
45