mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
[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.
This commit is contained in:
parent
10a626a1d6
commit
e5d1831517
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ std::vector<unsigned char> NetGroupManager::GetGroup(const CNetAddr& address) co
|
||||||
// ...for the last byte, push nBits and for the rest of the byte push 1's
|
// ...for the last byte, push nBits and for the rest of the byte push 1's
|
||||||
if (nBits > 0) {
|
if (nBits > 0) {
|
||||||
assert(num_bytes < addr_bytes.size());
|
assert(num_bytes < addr_bytes.size());
|
||||||
vchRet.push_back(addr_bytes[num_bytes] | ((1 << (8 - nBits)) - 1));
|
vchRet.push_back(addr_bytes[num_bytes + nStartByte] | ((1 << (8 - nBits)) - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
return vchRet;
|
return vchRet;
|
||||||
|
|
Loading…
Add table
Reference in a new issue