aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-05-28 15:32:30 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-13 23:53:06 +0200
commit1111b80df84aa7bc72fbddcc7bafde43f0835d90 (patch)
tree62c4a019d9f1fab94fea3894735ff77d2bc1ffff /src/net.h
parentbe9711e597071c813bdd72c2866c547f117e4865 (diff)
Rework addnode behaviour
* Use CNode::addeName to track whether a connection to a name is already open * A new connection to a previously-connected by-name addednode is only opened when the previous one closes (even if the name starts resolving to something else) * At most one connection is opened per addednode (even if the name resolves to multiple) * Unify the code between ThreadOpenAddedNodeConnections and getaddednodeinfo * Information about open connections is always returned, and the dns argument becomes a dummy * An IP address and inbound/outbound is only reported for the (at most 1) open connection
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 2aaca4888f..54a86d88dc 100644
--- a/src/net.h
+++ b/src/net.h
@@ -818,4 +818,14 @@ public:
/** Return a timestamp in the future (in microseconds) for exponentially distributed events. */
int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds);
+struct AddedNodeInfo
+{
+ std::string strAddedNode;
+ CService resolvedAddress;
+ bool fConnected;
+ bool fInbound;
+};
+
+std::vector<AddedNodeInfo> GetAddedNodeInfo();
+
#endif // BITCOIN_NET_H