mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
getPeerVector function.
This commit is contained in:
@@ -215,6 +215,19 @@ Json::Value ConnectionPool::getPeersJson()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Peer::pointer> ConnectionPool::getPeerVector()
|
||||||
|
{
|
||||||
|
std::vector<Peer::pointer> ret;
|
||||||
|
ret.resize(mConnectedMap.size());
|
||||||
|
|
||||||
|
BOOST_FOREACH(naPeer pair, mConnectedMap)
|
||||||
|
{
|
||||||
|
ret.push_back(pair.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
// Now know peer's node public key. Determine if we want to stay connected.
|
// Now know peer's node public key. Determine if we want to stay connected.
|
||||||
bool ConnectionPool::peerConnected(Peer::pointer peer, const NewcoinAddress& na)
|
bool ConnectionPool::peerConnected(Peer::pointer peer, const NewcoinAddress& na)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public:
|
|||||||
void peerFailed(const std::string& strIp, int iPort);
|
void peerFailed(const std::string& strIp, int iPort);
|
||||||
|
|
||||||
Json::Value getPeersJson();
|
Json::Value getPeersJson();
|
||||||
|
std::vector<Peer::pointer> getPeerVector();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Scanning
|
// Scanning
|
||||||
|
|||||||
Reference in New Issue
Block a user