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
This commit is contained in:
parent
be9711e597
commit
1111b80df8
3 changed files with 94 additions and 124 deletions
src
10
src/net.h
10
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue