Skip to content

Commit 13642a5

Browse files
morcosluke-jr
authored andcommitted
Fix masking of irrelevant bits in address groups.
1 parent 6b51b9b commit 13642a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/netbase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ std::vector<unsigned char> CNetAddr::GetGroup() const
980980
nBits -= 8;
981981
}
982982
if (nBits > 0)
983-
vchRet.push_back(GetByte(15 - nStartByte) | ((1 << nBits) - 1));
983+
vchRet.push_back(GetByte(15 - nStartByte) | ((1 << (8 - nBits)) - 1));
984984

985985
return vchRet;
986986
}

0 commit comments

Comments
 (0)