Skip to content

Commit ffad348

Browse files
committed
Merge #19705: Shrink CAddress from 48 to 40 bytes on x64
767073f Shrink CAddress from 48 to 40 bytes on x64 (Vasil Dimov) Pull request description: `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. ACKs for top commit: laanwj: ACK 767073f theStack: ACK bitcoin/bitcoin@767073f Tree-SHA512: 73d6a4fcfa2687b4076950801871252e369510ecf09f820576dbeca9ee3ee94d14672e7d5596cb45fedd9e4b973dd0716a2ea3f13fc3058b4b697d036a7c9db0
2 parents a57af89 + 767073f commit ffad348

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/protocol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,10 @@ class CAddress : public CService
374374
READWRITEAS(CService, obj);
375375
}
376376

377-
ServiceFlags nServices{NODE_NONE};
378377
// disk and network only
379378
uint32_t nTime{TIME_INIT};
379+
380+
ServiceFlags nServices{NODE_NONE};
380381
};
381382

382383
/** getdata message type flags */

0 commit comments

Comments
 (0)