thisflag should be declared as FlagSpecificData reference

With the current code there's now way that the seeder
returns peers addresses upon dns requests.

Thanks to @gandrewstone for good catch.
This commit is contained in:
Andrea Suisani 2017-01-12 23:59:33 +01:00
parent d5764c9149
commit 9e4e6342b7
No known key found for this signature in database
GPG key ID: A9CA1D0EE3789741

View file

@ -217,7 +217,7 @@ public:
nets[NET_IPV6] = true;
}
time_t now = time(NULL);
FlagSpecificData thisflag = perflag[requestedFlags];
FlagSpecificData& thisflag = perflag[requestedFlags];
thisflag.cacheHits++;
if (force || thisflag.cacheHits * 400 > (thisflag.cache.size()*thisflag.cache.size()) || (thisflag.cacheHits*thisflag.cacheHits * 20 > thisflag.cache.size() && (now - thisflag.cacheTime > 5))) {
set<CNetAddr> ips;