1
0
Fork 0
forked from lthn/blockchain

bug that have been there for ages

This commit is contained in:
cryptozoidberg 2025-06-06 21:18:41 +04:00
parent 79f4c3ef75
commit 87fae9440c
No known key found for this signature in database
GPG key ID: 2E10CC61CAC8F36D

View file

@ -176,9 +176,9 @@ namespace nodetool
inline void peerlist_manager::trim_white_peerlist()
{
CRITICAL_REGION_LOCAL(m_peerlist_lock);
while(m_peers_gray.size() > P2P_LOCAL_GRAY_PEERLIST_LIMIT)
while(m_peers_white.size() > P2P_LOCAL_GRAY_PEERLIST_LIMIT)
{
peers_indexed::index<by_time>::type& sorted_index=m_peers_gray.get<by_time>();
peers_indexed::index<by_time>::type& sorted_index= m_peers_white.get<by_time>();
sorted_index.erase(sorted_index.begin());
}
}
@ -186,9 +186,9 @@ namespace nodetool
inline void peerlist_manager::trim_gray_peerlist()
{
CRITICAL_REGION_LOCAL(m_peerlist_lock);
while(m_peers_white.size() > P2P_LOCAL_WHITE_PEERLIST_LIMIT)
while(m_peers_gray.size() > P2P_LOCAL_WHITE_PEERLIST_LIMIT)
{
peers_indexed::index<by_time>::type& sorted_index=m_peers_white.get<by_time>();
peers_indexed::index<by_time>::type& sorted_index=m_peers_gray.get<by_time>();
sorted_index.erase(sorted_index.begin());
}
}