[netgroupman] Add GetMappedAS() and GetGroup()

These currently call through to the CNetAddr methods. The logic will be moved in a future commit.
This commit is contained in:
John Newbery
2021-09-01 12:12:52 +01:00
parent 19431560e3
commit 6b2268162e
8 changed files with 91 additions and 74 deletions

View File

@@ -76,15 +76,15 @@ public:
}
//! Calculate in which "tried" bucket this entry belongs
int GetTriedBucket(const uint256 &nKey, const std::vector<bool> &asmap) const;
int GetTriedBucket(const uint256& nKey, const NetGroupManager& netgroupman) const;
//! Calculate in which "new" bucket this entry belongs, given a certain source
int GetNewBucket(const uint256 &nKey, const CNetAddr& src, const std::vector<bool> &asmap) const;
int GetNewBucket(const uint256& nKey, const CNetAddr& src, const NetGroupManager& netgroupman) const;
//! Calculate in which "new" bucket this entry belongs, using its default source
int GetNewBucket(const uint256 &nKey, const std::vector<bool> &asmap) const
int GetNewBucket(const uint256& nKey, const NetGroupManager& netgroupman) const
{
return GetNewBucket(nKey, source, asmap);
return GetNewBucket(nKey, source, netgroupman);
}
//! Calculate in which position of a bucket to store this entry.