aboutsummaryrefslogtreecommitdiff
path: root/src/netgroup.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-09-01 15:55:32 +0100
committerJohn Newbery <john@johnnewbery.com>2022-04-20 14:35:52 +0100
commit1b978a7e8c71dcc1501705022e66f6779c8c4528 (patch)
tree4f306a9e8bb07d82e6caa35782f2b072434a0f0b /src/netgroup.h
parentddb4101e6377a998b7c598bf52217b47698ddec9 (diff)
downloadbitcoin-1b978a7e8c71dcc1501705022e66f6779c8c4528.tar.xz
[netgroupman] Move GetMappedAS() and GetGroup() logic to NetGroupManager
Reviewer hint: use: `git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
Diffstat (limited to 'src/netgroup.h')
-rw-r--r--src/netgroup.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/netgroup.h b/src/netgroup.h
index 46afc6e3c5..4e4edb8a88 100644
--- a/src/netgroup.h
+++ b/src/netgroup.h
@@ -22,8 +22,23 @@ public:
* exists, since the data is const. */
const std::vector<bool>& GetAsmap() const { return m_asmap; }
+ /**
+ * Get the canonical identifier of the network group for address.
+ *
+ * The groups are assigned in a way where it should be costly for an attacker to
+ * obtain addresses with many different group identifiers, even if it is cheap
+ * to obtain addresses with the same identifier.
+ *
+ * @note No two connections will be attempted to addresses with the same network
+ * group.
+ */
std::vector<unsigned char> GetGroup(const CNetAddr& address) const;
+ /**
+ * Get the autonomous system on the BGP path to address.
+ *
+ * The ip->AS mapping depends on how asmap is constructed.
+ */
uint32_t GetMappedAS(const CNetAddr& address) const;
private: