diff options
| author | Jon Atack <[email protected]> | 2020-07-28 10:47:07 +0200 |
|---|---|---|
| committer | Jon Atack <[email protected]> | 2020-08-27 10:57:20 +0200 |
| commit | 407175e0c2bc797599ebd9c0a1f2ec89ad7af136 (patch) | |
| tree | 0596e5fc557db4c9f2ef296f429d453750d79989 /src/protocol.h | |
| parent | Merge #19761: build: improve sed robustness by not using sed (diff) | |
| download | discoin-407175e0c2bc797599ebd9c0a1f2ec89ad7af136.tar.xz discoin-407175e0c2bc797599ebd9c0a1f2ec89ad7af136.zip | |
p2p: change CInv::type from int to uint32_t
fixes issue #19678 UBSan implicit-integer-sign-change
Credit to Eugene (Crypt-iQ) for finding and reporting the issue
and to Vasil Dimov (vasild) for the original suggestion
Diffstat (limited to 'src/protocol.h')
| -rw-r--r-- | src/protocol.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol.h b/src/protocol.h index 2e6c767cd..415922dfb 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -408,7 +408,7 @@ class CInv { public: CInv(); - CInv(int typeIn, const uint256& hashIn); + CInv(uint32_t typeIn, const uint256& hashIn); SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); } @@ -425,7 +425,7 @@ public: // Combined-message helper methods bool IsGenTxMsg() const { return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX; } - int type; + uint32_t type; uint256 hash; }; |