mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 01:07:57 +00:00
Remove extraneous index from peerfinder map.
This commit is contained in:
@@ -40,10 +40,7 @@ typedef boost::multi_index_container <
|
|||||||
PeerInfo, boost::multi_index::indexed_by <
|
PeerInfo, boost::multi_index::indexed_by <
|
||||||
boost::multi_index::hashed_unique <
|
boost::multi_index::hashed_unique <
|
||||||
BOOST_MULTI_INDEX_MEMBER(PeerFinder::PeerInfo,PeerID,id),
|
BOOST_MULTI_INDEX_MEMBER(PeerFinder::PeerInfo,PeerID,id),
|
||||||
PeerID::hasher>,
|
PeerID::hasher>
|
||||||
boost::multi_index::hashed_unique <
|
|
||||||
BOOST_MULTI_INDEX_MEMBER(PeerFinder::PeerInfo,beast::IPEndpoint,address),
|
|
||||||
IPEndpoint::hasher>
|
|
||||||
>
|
>
|
||||||
> Peers;
|
> Peers;
|
||||||
|
|
||||||
@@ -216,7 +213,8 @@ public:
|
|||||||
|
|
||||||
// Called when a peer connection is established.
|
// Called when a peer connection is established.
|
||||||
// We are guaranteed that the PeerID is not already in our map.
|
// 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,
|
void onPeerConnected (PeerID const& id,
|
||||||
IPEndpoint const& address, bool inbound)
|
IPEndpoint const& address, bool inbound)
|
||||||
{
|
{
|
||||||
@@ -224,6 +222,7 @@ public:
|
|||||||
// If this is outgoing, record the success
|
// If this is outgoing, record the success
|
||||||
if (! inbound)
|
if (! inbound)
|
||||||
m_legacyCache.checked (address, true);
|
m_legacyCache.checked (address, true);
|
||||||
|
|
||||||
std::pair <Peers::iterator, bool> result (
|
std::pair <Peers::iterator, bool> result (
|
||||||
m_peers.insert (
|
m_peers.insert (
|
||||||
PeerInfo (id, address, inbound)));
|
PeerInfo (id, address, inbound)));
|
||||||
|
|||||||
Reference in New Issue
Block a user