Skip to content

Commit bba3db1

Browse files
committed
Fix masking of irrelevant bits in address groups.
1 parent ddd8d80 commit bba3db1

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
@@ -983,7 +983,7 @@ std::vector<unsigned char> CNetAddr::GetGroup() const
983983
nBits -= 8;
984984
}
985985
if (nBits > 0)
986-
vchRet.push_back(GetByte(15 - nStartByte) | ((1 << nBits) - 1));
986+
vchRet.push_back(GetByte(15 - nStartByte) | ((1 << (8 - nBits)) - 1));
987987

988988
return vchRet;
989989
}

0 commit comments

Comments
 (0)