diff --git a/src/protocol.cpp b/src/protocol.cpp index de57f025d34733..a73621f7e42328 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -265,7 +265,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 af184c9d534dcf..02fdbdb814547f 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -534,7 +534,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); } @@ -555,7 +555,7 @@ class CInv const char* GetCommandInternal() const; public: - int type; + uint32_t type; uint256 hash; }; diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index b289ba2d08573c..5a81ff726cdace 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -323,7 +323,7 @@ class CInv: MSG_TX: "TX", MSG_BLOCK: "Block", MSG_FILTERED_BLOCK: "filtered Block", - 20: "CompactBlock" + MSG_CMPCT_BLOCK: "CompactBlock", } def __init__(self, t=0, h=0): @@ -331,12 +331,12 @@ def __init__(self, t=0, h=0): self.hash = h def deserialize(self, f): - self.type = struct.unpack("