From e5d183151709ab59d2fa6fe9e0243000e8d6abbe Mon Sep 17 00:00:00 2001 From: dergoegge Date: Mon, 25 Apr 2022 15:08:38 +0200 Subject: [PATCH] [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. --- src/netgroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netgroup.cpp b/src/netgroup.cpp index 5f42d6c7191..96b5e296845 100644 --- a/src/netgroup.cpp +++ b/src/netgroup.cpp @@ -71,7 +71,7 @@ std::vector NetGroupManager::GetGroup(const CNetAddr& address) co // ...for the last byte, push nBits and for the rest of the byte push 1's if (nBits > 0) { 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;