[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

@@ -5,6 +5,8 @@
#ifndef BITCOIN_NETGROUP_H
#define BITCOIN_NETGROUP_H
#include <netaddress.h>
#include <vector>
/**
@@ -20,6 +22,10 @@ public:
* exists, since the data is const. */
const std::vector<bool>& GetAsmap() const { return m_asmap; }
std::vector<unsigned char> GetGroup(const CNetAddr& address) const;
uint32_t GetMappedAS(const CNetAddr& address) const;
private:
/** Compressed IP->ASN mapping, loaded from a file when a node starts.
*