aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2020-10-16 11:10:17 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2020-10-27 11:15:21 -0400
commite8b215a086d91a8774210bb6ce8d1560aaaf0789 (patch)
tree9d4018c2fde49bf922ef39b7accdcec067ea0d74 /src/net.h
parent4fe338ab3ed73b3ffb20eedf95500c56ec2920e1 (diff)
Refactor test for existing peer connection into own function
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index fc01f44dd2..77649247d9 100644
--- a/src/net.h
+++ b/src/net.h
@@ -442,6 +442,12 @@ private:
CNode* FindNode(const std::string& addrName);
CNode* FindNode(const CService& addr);
+ /**
+ * Determine whether we're already connected to a given address, in order to
+ * avoid initiating duplicate connections.
+ */
+ bool AlreadyConnectedToAddress(const CAddress& addr);
+
bool AttemptToEvictConnection();
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type);
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr) const;