mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-25 16:31:29 +02:00
p2p: Add CConnman::GetCurrentBlockRelayOnlyConns()
This commit is contained in:
parent
c29272a157
commit
bad16aff49
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…
x
Reference in New Issue
Block a user