diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-05-28 15:32:30 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-06-13 23:53:06 +0200 |
commit | 1111b80df84aa7bc72fbddcc7bafde43f0835d90 (patch) | |
tree | 62c4a019d9f1fab94fea3894735ff77d2bc1ffff /src/net.h | |
parent | be9711e597071c813bdd72c2866c547f117e4865 (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.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |