+ if (RemoveIfExpired(i))
+ return NULL; // expired
+
+ return i->second; // hit.
+}
+
+bool BanCacheManager::RemoveIfExpired(BanCacheHash::iterator& it)
+{
+ if (ServerInstance->Time() < it->second->Expiry)
+ return false;
+
+ ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "Hit on " + it->first + " is out of date, removing!");
+ delete it->second;
+ it = BanHash.erase(it);
+ return true;