BIP155 (addrv2)
Tor v3 + i2p
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include "txmempool.h"
|
||||
#include "uint256.h"
|
||||
#include "util.h"
|
||||
#include "utilstrencodings.h"
|
||||
#include "util/strencodings.h"
|
||||
#include <univalue.h>
|
||||
#include <algorithm> // for std::reverse
|
||||
#include <string>
|
||||
@@ -114,12 +114,19 @@ namespace { // better to use anonymous namespace for helper routines
|
||||
static bool InitStratumAllowList(std::vector<CSubNet>& allowed_subnets)
|
||||
{
|
||||
allowed_subnets.clear();
|
||||
allowed_subnets.push_back(CSubNet("127.0.0.0/8")); // always allow IPv4 local subnet
|
||||
allowed_subnets.push_back(CSubNet("::1")); // always allow IPv6 localhost
|
||||
CNetAddr localv4, localv6;
|
||||
LookupHost("127.0.0.1", localv4, false);
|
||||
LookupHost("::1", localv6, false);
|
||||
|
||||
allowed_subnets.push_back(CSubNet(localv4, 8)); // always allow IPv4 local subnet
|
||||
allowed_subnets.push_back(CSubNet(localv6)); // always allow IPv6 localhost
|
||||
if (mapMultiArgs.count("-stratumallowip")) {
|
||||
const std::vector<std::string>& vAllow = mapMultiArgs["-stratumallowip"];
|
||||
for(const std::string& strAllow : vAllow) {
|
||||
CSubNet subnet(strAllow);
|
||||
CNetAddr netaddr;
|
||||
// todo: v6
|
||||
LookupHost(strAllow.c_str(), netaddr, false);
|
||||
CSubNet subnet(netaddr);
|
||||
if (!subnet.IsValid()) {
|
||||
uiInterface.ThreadSafeMessageBox(
|
||||
strprintf("Invalid -stratumallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow),
|
||||
|
||||
Reference in New Issue
Block a user