From 334f1094157583ba7d8050871e888b10584fb771 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Fri, 11 Oct 2013 18:33:24 -0700 Subject: [PATCH] Remove extraneous index from peerfinder map. --- src/ripple/peerfinder/impl/Logic.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index 4bb8ca873..079c0151a 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -40,10 +40,7 @@ typedef boost::multi_index_container < PeerInfo, boost::multi_index::indexed_by < boost::multi_index::hashed_unique < BOOST_MULTI_INDEX_MEMBER(PeerFinder::PeerInfo,PeerID,id), - PeerID::hasher>, - boost::multi_index::hashed_unique < - BOOST_MULTI_INDEX_MEMBER(PeerFinder::PeerInfo,beast::IPEndpoint,address), - IPEndpoint::hasher> + PeerID::hasher> > > Peers; @@ -216,7 +213,8 @@ public: // Called when a peer connection is established. // We are guaranteed that the PeerID is not already in our map. - // + // but we are *NOT* guaranteed that the IP isn't. So we need + // to be careful. void onPeerConnected (PeerID const& id, IPEndpoint const& address, bool inbound) { @@ -224,6 +222,7 @@ public: // If this is outgoing, record the success if (! inbound) m_legacyCache.checked (address, true); + std::pair result ( m_peers.insert ( PeerInfo (id, address, inbound)));