From f761d826cf0d01451afdb558818548fdc0b13ede Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 26 Apr 2012 15:21:02 -0700 Subject: [PATCH] Use NewcoingAddress in mConnectionPool. --- src/ConnectionPool.cpp | 5 ++--- src/ConnectionPool.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ConnectionPool.cpp b/src/ConnectionPool.cpp index 65479b624..4fae2ac89 100644 --- a/src/ConnectionPool.cpp +++ b/src/ConnectionPool.cpp @@ -122,10 +122,9 @@ void ConnectionPool::peerDisconnected(Peer::pointer peer) // XXX Don't access member variable directly. if (peer->mPublicKey.isValid()) { - // XXX Would be better if NewcoinAddress had a hash function. - boost::unordered_map, Peer::pointer>::iterator itCm; + boost::unordered_map::iterator itCm; - itCm = mConnectedMap.find(peer->mPublicKey.getNodePublic()); + itCm = mConnectedMap.find(peer->mPublicKey); if (itCm == mConnectedMap.end()) { diff --git a/src/ConnectionPool.h b/src/ConnectionPool.h index a2aafc61f..b19c27af8 100644 --- a/src/ConnectionPool.h +++ b/src/ConnectionPool.h @@ -15,7 +15,7 @@ class ConnectionPool private: boost::mutex mPeerLock; - typedef std::pair, Peer::pointer> naPeer; + typedef std::pair naPeer; // Count of peers we are in progress of connecting to. // We are in progress until we know their network public key. @@ -25,7 +25,7 @@ private: boost::unordered_map mIpMap; // Non-thin peers which we are connected to. - boost::unordered_map, Peer::pointer> mConnectedMap; + boost::unordered_map mConnectedMap; public: ConnectionPool();