mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Use NewcoingAddress in mConnectionPool.
This commit is contained in:
@@ -122,10 +122,9 @@ void ConnectionPool::peerDisconnected(Peer::pointer peer)
|
|||||||
// XXX Don't access member variable directly.
|
// XXX Don't access member variable directly.
|
||||||
if (peer->mPublicKey.isValid())
|
if (peer->mPublicKey.isValid())
|
||||||
{
|
{
|
||||||
// XXX Would be better if NewcoinAddress had a hash function.
|
boost::unordered_map<NewcoinAddress, Peer::pointer>::iterator itCm;
|
||||||
boost::unordered_map<std::vector<unsigned char>, Peer::pointer>::iterator itCm;
|
|
||||||
|
|
||||||
itCm = mConnectedMap.find(peer->mPublicKey.getNodePublic());
|
itCm = mConnectedMap.find(peer->mPublicKey);
|
||||||
|
|
||||||
if (itCm == mConnectedMap.end())
|
if (itCm == mConnectedMap.end())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ConnectionPool
|
|||||||
private:
|
private:
|
||||||
boost::mutex mPeerLock;
|
boost::mutex mPeerLock;
|
||||||
|
|
||||||
typedef std::pair<std::vector<unsigned char>, Peer::pointer> naPeer;
|
typedef std::pair<NewcoinAddress, Peer::pointer> naPeer;
|
||||||
|
|
||||||
// Count of peers we are in progress of connecting to.
|
// Count of peers we are in progress of connecting to.
|
||||||
// We are in progress until we know their network public key.
|
// We are in progress until we know their network public key.
|
||||||
@@ -25,7 +25,7 @@ private:
|
|||||||
boost::unordered_map<ipPort, Peer::pointer> mIpMap;
|
boost::unordered_map<ipPort, Peer::pointer> mIpMap;
|
||||||
|
|
||||||
// Non-thin peers which we are connected to.
|
// Non-thin peers which we are connected to.
|
||||||
boost::unordered_map<std::vector<unsigned char>, Peer::pointer> mConnectedMap;
|
boost::unordered_map<NewcoinAddress, Peer::pointer> mConnectedMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConnectionPool();
|
ConnectionPool();
|
||||||
|
|||||||
Reference in New Issue
Block a user