aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2019-01-29 13:40:45 -1000
committerJonas Schnelli <dev@jonasschnelli.ch>2019-01-29 13:41:04 -1000
commit2d790e82c809c3be2c68376964b6d453b8525caf (patch)
tree78fe93202d5db48570c8f7c83c6d9b122eca4441 /src/net.h
parent7275365c9bc7e7ebd6bbf7dcb251946aac44b5de (diff)
parent0297be61acdf1cdd5f56c8371d1718d08229d9b3 (diff)
downloadbitcoin-2d790e82c809c3be2c68376964b6d453b8525caf.tar.xz
Merge #14929: net: Allow connections from misbehavior banned peers
0297be61a Allow connections from misbehavior banned peers. (Gregory Maxwell) Pull request description: 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. This can reduce the potential from negative impact due to incorrect misbehaviour bans. Tree-SHA512: 03bc8ec8bae365cc437daf70000c8f2edc512e37db821bc4e0fafa6cf56cc185e9ab40453aa02445f48d6a2e3e7268767ca2017655aca5383108416f1e2cf20f
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 4449a36ecd..3c1a107b43 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};