aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-25 23:56:17 +0100
committerJon Atack <jon@atack.com>2021-03-19 20:11:45 +0100
commit8b1e156143740a5548dc7b601d40fb141e6aae1c (patch)
tree190c7430ca8c2cdf81ead7b20f718cae19ba1348 /src/net.h
parent72e30e8e03f880eba4bd1c3fc18b5558d8cef680 (diff)
downloadbitcoin-8b1e156143740a5548dc7b601d40fb141e6aae1c.tar.xz
Add m_inbound_onion to AttemptToEvictConnection()
and an `m_is_onion` struct member to NodeEvictionCandidate and tests. We'll use these in the peer eviction logic to protect inbound onion peers in addition to the existing protection of localhost peers.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index c15ca32816..bf8458be6e 100644
--- a/src/net.h
+++ b/src/net.h
@@ -425,6 +425,7 @@ public:
std::atomic<int64_t> nLastSend{0};
std::atomic<int64_t> nLastRecv{0};
+ //! Unix epoch time at peer connection, in seconds.
const int64_t nTimeConnected;
std::atomic<int64_t> nTimeOffset{0};
// Address of this peer
@@ -1281,6 +1282,7 @@ struct NodeEvictionCandidate
uint64_t nKeyedNetGroup;
bool prefer_evict;
bool m_is_local;
+ bool m_is_onion;
};
/**