aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2018-12-11 21:07:36 +0000
committerGregory Maxwell <greg@xiph.org>2019-01-22 21:10:48 +0000
commit0297be61acdf1cdd5f56c8371d1718d08229d9b3 (patch)
treeadd640a4a3c30cb470c7259b2c1018ee94b9a892 /src/net.h
parent9bad1e0b22c1065c5ab73d74ac96747ecf33dcdf (diff)
downloadbitcoin-0297be61acdf1cdd5f56c8371d1718d08229d9b3.tar.xz
Allow connections from misbehavior banned peers.
This allows incoming connections from peers which are only banned due to an automatic misbehavior ban if doing so won't fill inbound. These peers are preferred for eviction when inbound fills, but may still be kept if they fall into the protected classes. This eviction preference lasts the entire life of the connection even if the ban expires. If they misbehave again they'll still get disconnected. The main purpose of banning on misbehavior is to prevent our connections from being wasted on unhelpful peers such as ones running incompatible consensus rules. For inbound peers this can be better accomplished with eviction preferences. A secondary purpose was to reduce resource waste from repeated abuse but virtually any attacker can get a nearly unlimited supply of addresses, so disconnection is about the best we can do.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 9c477f6db6..73b0b9fad3 100644
--- a/src/net.h
+++ b/src/net.h
@@ -651,6 +651,7 @@ public:
// the network or wire types and the cleaned string used when displayed or logged.
std::string strSubVer GUARDED_BY(cs_SubVer), cleanSubVer GUARDED_BY(cs_SubVer);
CCriticalSection cs_SubVer; // used for both cleanSubVer and strSubVer
+ bool m_prefer_evict{false}; // This peer is preferred for eviction.
bool fWhitelisted{false}; // This peer can bypass DoS banning.
bool fFeeler{false}; // If true this node is being used as a short lived feeler.
bool fOneShot{false};