aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2020-08-12 12:40:25 +0200
committerVasil Dimov <vd@FreeBSD.org>2020-08-12 16:00:11 +0200
commit767073fb9645f5cb0976a14288c03fe71912b569 (patch)
tree836b8627640eb65f7fc6777465a7bc0f0f41eed8 /src/protocol.h
parentbd00d3b1f2036893419d1e8c514a8af2c4e4b1fb (diff)
downloadbitcoin-767073fb9645f5cb0976a14288c03fe71912b569.tar.xz
Shrink CAddress from 48 to 40 bytes on x64
`CAddress` inherits `CService` which is 28 bytes (on 64 bit machines). `CAddress` then adds two member variables - one that requires 4 byte alignment (`nTime`) and one that requires 8 byte alignment (`nServices`). Declare the smaller one first so that it fits in bytes 29..32. On 32 bit machines this change has no effect and `CAddress` remains 40 bytes.
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/protocol.h b/src/protocol.h
index 1d0adaae6e..e61e4935a3 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -371,9 +371,10 @@ public:
READWRITEAS(CService, obj);
}
- ServiceFlags nServices{NODE_NONE};
// disk and network only
uint32_t nTime{TIME_INIT};
+
+ ServiceFlags nServices{NODE_NONE};
};
/** getdata message type flags */