| 217 | } |
| 218 | |
| 219 | const std::vector<std::shared_ptr<const Lease> > LeaseSet::GetNonExpiredLeasesExcluding (LeaseInspectFunc exclude, bool withThreshold) const |
| 220 | { |
| 221 | auto ts = i2p::util::GetMillisecondsSinceEpoch (); |
| 222 | std::vector<std::shared_ptr<const Lease> > leases; |
| 223 | for (const auto& it: m_Leases) |
| 224 | { |
| 225 | auto endDate = it->endDate; |
| 226 | if (withThreshold) |
| 227 | endDate += LEASE_ENDDATE_THRESHOLD; |
| 228 | else |
| 229 | endDate -= LEASE_ENDDATE_THRESHOLD; |
| 230 | if (ts < endDate && !exclude(*it)) |
| 231 | leases.push_back (it); |
| 232 | } |
| 233 | return leases; |
| 234 | } |
| 235 | |
| 236 | bool LeaseSet::HasExpiredLeases () const |
| 237 | { |
no test coverage detected