Skip to content

Commit e5d1831

Browse files
committed
[netgroup] Use nStartByte as offset for the last byte of the group
Should we ever introduce a new address type that makes use of `nStartByte` and adds fractional bytes to the group, then nStartByte should be used as the offset for the last byte.
1 parent 10a626a commit e5d1831

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/netgroup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ std::vector<unsigned char> NetGroupManager::GetGroup(const CNetAddr& address) co
7171
// ...for the last byte, push nBits and for the rest of the byte push 1's
7272
if (nBits > 0) {
7373
assert(num_bytes < addr_bytes.size());
74-
vchRet.push_back(addr_bytes[num_bytes] | ((1 << (8 - nBits)) - 1));
74+
vchRet.push_back(addr_bytes[num_bytes + nStartByte] | ((1 << (8 - nBits)) - 1));
7575
}
7676

7777
return vchRet;

0 commit comments

Comments
 (0)