diff options
| author | Wladimir J. van der Laan <[email protected]> | 2020-09-03 17:23:29 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2020-09-03 17:23:52 +0200 |
| commit | bd60a9a8edd4a3fe2f4f605b77cdae34969eaaf2 (patch) | |
| tree | cca60fbc4b5bc4a5b366dcbe8eb5f259109b1c96 /src/protocol.cpp | |
| parent | Merge #19670: Protect localhost and block-relay-only peers from eviction (diff) | |
| parent | test framework: serialize/deserialize inv type as unsigned int (diff) | |
| download | discoin-bd60a9a8edd4a3fe2f4f605b77cdae34969eaaf2.tar.xz discoin-bd60a9a8edd4a3fe2f4f605b77cdae34969eaaf2.zip | |
Merge #19818: p2p: change `CInv::type` from `int` to `uint32_t`, fix UBSan warning
7984c39be11ca04460883365e1ae2a496aaa6c0e test framework: serialize/deserialize inv type as unsigned int (Jon Atack)
407175e0c2bc797599ebd9c0a1f2ec89ad7af136 p2p: change CInv::type from int to uint32_t (Jon Atack)
Pull request description:
Fixes UBSan implicit-integer-sign-change issue per https://github.com/bitcoin/bitcoin/pull/19610#issuecomment-680686460.
Credit to Crypt-iQ for finding and reporting the issue and to vasild for the original review suggestion in https://github.com/bitcoin/bitcoin/pull/19590#pullrequestreview-455788826.
Closes #19678.
ACKs for top commit:
laanwj:
ACK 7984c39be11ca04460883365e1ae2a496aaa6c0e
MarcoFalke:
ACK 7984c39be11ca04460883365e1ae2a496aaa6c0e 🌻
vasild:
ACK 7984c39be
Tree-SHA512: 59f3a75f40ce066ca6f0bb1927197254238302b4073af1574bdbfe6ed580876437be804be4e47d51467d604f0d9e3a5875159f7f2edbb2351fdb2bb9465100b5
Diffstat (limited to 'src/protocol.cpp')
| -rw-r--r-- | src/protocol.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index c989aa390..1f2e62854 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -163,7 +163,7 @@ CInv::CInv() hash.SetNull(); } -CInv::CInv(int typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) {} +CInv::CInv(uint32_t typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) {} bool operator<(const CInv& a, const CInv& b) { |