p2p: Add CConnman::GetCurrentBlockRelayOnlyConns()

This commit is contained in:
Hennadii Stepanov committed 2020-10-09 14:29:04 +03:00
1 parent c29272a157
commit bad16aff49
2 files changed
+18

No files matched your search

+13
View File
@@ -2019,6 +2019,19 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
}
}
std::vector<CAddress> CConnman::GetCurrentBlockRelayOnlyConns() const
{
std::vector<CAddress> ret;
LOCK(cs_vNodes);
for (const CNode* pnode : vNodes) {
if (pnode->IsBlockOnlyConn()) {
ret.push_back(pnode->addr);
}
}
return ret;
}
std::vector<AddedNodeInfo> CConnman::GetAddedNodeInfo()
{
std::vector<AddedNodeInfo> ret;
+5
View File
@@ -460,6 +460,11 @@ private:
void RecordBytesRecv(uint64_t bytes);
void RecordBytesSent(uint64_t bytes);
/**
* Return vector of current BLOCK_RELAY peers.
*/
std::vector<CAddress> GetCurrentBlockRelayOnlyConns() const;
// Whether the node should be passed out in ForEach* callbacks
static bool NodeFullyConnected(const CNode* pnode);