Cache country lookup result in PeerInfo class
@ -64,7 +64,9 @@ bool PeerInfo::fromLSD() const
#ifndef DISABLE_COUNTRIES_RESOLUTION
QString PeerInfo::country() const
{
return Net::GeoIPManager::instance()->lookup(address().ip);
if (m_country.isEmpty())
m_country = Net::GeoIPManager::instance()->lookup(address().ip);
return m_country;
}
#endif
@ -102,6 +102,10 @@ namespace BitTorrent
qreal m_relevance = 0;
QString m_flags;
QString m_flagsDescription;
mutable QString m_country;
};