From bad16aff490dcf87722fbfe202a869fb24c734e1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 12 Sep 2020 18:03:06 +0300 Subject: p2p: Add CConnman::GetCurrentBlockRelayOnlyConns() --- src/net.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index 2b99d3bd9d..adeee1579a 100644 --- a/src/net.h +++ b/src/net.h @@ -460,6 +460,11 @@ private: void RecordBytesRecv(uint64_t bytes); void RecordBytesSent(uint64_t bytes); + /** + * Return vector of current BLOCK_RELAY peers. + */ + std::vector GetCurrentBlockRelayOnlyConns() const; + // Whether the node should be passed out in ForEach* callbacks static bool NodeFullyConnected(const CNode* pnode); -- cgit v1.2.3 From 4170b46544231e7cf1d64ac3baa314083be37502 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 12 Sep 2020 18:05:54 +0300 Subject: p2p: Integrate DumpAnchors() and ReadAnchors() into CConnman --- src/net.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index adeee1579a..7b7885f839 100644 --- a/src/net.h +++ b/src/net.h @@ -566,6 +566,12 @@ private: /** Pointer to this node's banman. May be nullptr - check existence before dereferencing. */ BanMan* m_banman; + /** + * Addresses that were saved during the previous clean shutdown. We'll + * attempt to make block-relay-only connections to them. + */ + std::vector m_anchors; + /** SipHasher seeds for deterministic randomness */ const uint64_t nSeed0, nSeed1; -- cgit v1.2.3 From 0a85e5a7bc8dc6587963e2e37ac1b087a1fc97fe Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:38:09 +0300 Subject: p2p: Try to connect to anchors once --- src/net.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index 7b7885f839..616b986e4a 100644 --- a/src/net.h +++ b/src/net.h @@ -174,7 +174,9 @@ enum class ConnectionType { * attacks. By not relaying transactions or addresses, these connections * are harder to detect by a third party, thus helping obfuscate the * network topology. We automatically attempt to open - * MAX_BLOCK_RELAY_ONLY_CONNECTIONS using addresses from our AddrMan. + * MAX_BLOCK_RELAY_ONLY_ANCHORS using addresses from our anchors.dat. Then + * addresses from our AddrMan if MAX_BLOCK_RELAY_ONLY_CONNECTIONS + * isn't reached yet. */ BLOCK_RELAY, -- cgit v1.2.3