mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
p2p: Add CConnman::GetCurrentBlockRelayOnlyConns()
This commit is contained in:
parent
c29272a157
commit
bad16aff49
2 changed files with 18 additions and 0 deletions
13
src/net.cpp
13
src/net.cpp
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue