The term 'whitelist' is racist and so we choose to call this feature 'allowlist'

This commit is contained in:
Duke Leto
2021-01-10 10:46:22 -05:00
parent 70f9ac87b6
commit cde6d33ad1
25 changed files with 131 additions and 139 deletions

View File

@@ -90,7 +90,7 @@ CNode* FindNode(const CService& ip);
CNode* ConnectNode(CAddress addrConnect, const char *pszDest = NULL);
bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
unsigned short GetListenPort();
bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false);
bool BindListenPort(const CService &bindAddr, std::string& strError, bool fAllowlisted = false);
void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler);
bool StopNode();
void SocketSendData(CNode *pnode);
@@ -214,7 +214,7 @@ public:
int nStartingHeight;
uint64_t nSendBytes;
uint64_t nRecvBytes;
bool fWhitelisted;
bool fAllowlisted;
double dPingTime;
double dPingWait;
std::string addrLocal;
@@ -312,7 +312,7 @@ public:
// store the sanitized version in cleanSubVer. The original should be used when dealing with
// the network or wire types and the cleaned string used when displayed or logged.
std::string strSubVer, cleanSubVer;
bool fWhitelisted; // This peer can bypass DoS banning.
bool fAllowlisted; // This peer can bypass DoS banning.
bool fOneShot;
bool fClient;
bool fInbound;
@@ -340,10 +340,10 @@ protected:
static std::map<CSubNet, int64_t> setBanned;
static CCriticalSection cs_setBanned;
// Whitelisted ranges. Any node connecting from these is automatically
// whitelisted (as well as those connecting to whitelisted binds).
static std::vector<CSubNet> vWhitelistedRange;
static CCriticalSection cs_vWhitelistedRange;
// Allowlisted ranges. Any node connecting from these is automatically
// allowlisted (as well as those connecting to allowlisted binds).
static std::vector<CSubNet> vAllowlistedRange;
static CCriticalSection cs_vAllowlistedRange;
// Basic fuzz-testing
void Fuzz(int nChance); // modifies ssSend
@@ -681,8 +681,8 @@ public:
void copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap);
static bool IsWhitelistedRange(const CNetAddr &ip);
static void AddWhitelistedRange(const CSubNet &subnet);
static bool IsAllowlistedRange(const CNetAddr &ip);
static void AddAllowlistedRange(const CSubNet &subnet);
// Network stats
static void RecordBytesRecv(uint64_t bytes);