diff --git a/src/protocol.cpp b/src/protocol.cpp index 46d50f8b0a..80a7bf78e9 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) { diff --git a/src/protocol.h b/src/protocol.h index fafb7bbc56..e52f29f2bc 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -410,7 +410,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); } @@ -437,7 +437,7 @@ public: return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK; } - int type; + uint32_t type; uint256 hash; }; diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index 1a92870fae..b133156858 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -245,8 +245,8 @@ class CInv: MSG_TX | MSG_WITNESS_FLAG: "WitnessTx", MSG_BLOCK | MSG_WITNESS_FLAG: "WitnessBlock", MSG_FILTERED_BLOCK: "filtered Block", - 4: "CompactBlock", - 5: "WTX", + MSG_CMPCT_BLOCK: "CompactBlock", + MSG_WTX: "WTX", } def __init__(self, t=0, h=0): @@ -254,12 +254,12 @@ class CInv: self.hash = h def deserialize(self, f): - self.type = struct.unpack("