MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / GetNonExpiredLeasesExcluding

Method GetNonExpiredLeasesExcluding

libi2pd/LeaseSet.cpp:219–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

GetSharedRoutingPathMethod · 0.80

Calls 2

push_backMethod · 0.80

Tested by

no test coverage detected