Introduce REQUIRED_SERVICES constant
This commit is contained in:
parent
ee06e04369
commit
ecd7fd37c8
3 changed files with 4 additions and 2 deletions
|
@ -4787,7 +4787,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||||
{
|
{
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
|
|
||||||
if (!(addr.nServices & NODE_NETWORK))
|
if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
|
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
|
||||||
|
|
|
@ -1596,7 +1596,7 @@ void ThreadOpenConnections()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// only connect to full nodes
|
// only connect to full nodes
|
||||||
if (!(addr.nServices & NODE_NETWORK))
|
if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// only consider very recently tried nodes after 30 failed attempts
|
// only consider very recently tried nodes after 30 failed attempts
|
||||||
|
|
|
@ -72,6 +72,8 @@ static const bool DEFAULT_FORCEDNSSEED = false;
|
||||||
static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
|
static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
|
||||||
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
|
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
|
||||||
|
|
||||||
|
static const ServiceFlags REQUIRED_SERVICES = NODE_NETWORK;
|
||||||
|
|
||||||
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
|
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
|
||||||
static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban
|
static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue