Time experemental options

This commit is contained in:
Alex 2018-03-01 08:58:05 +07:00
parent 5a2b795440
commit ea899fbbfd
17 changed files with 264 additions and 129 deletions

View file

@ -483,7 +483,7 @@ namespace client
LogPrint (eLogDebug, "Destination: Publishing LeaseSet is pending");
return;
}
auto ts = i2p::util::GetSecondsSinceEpoch ();
auto ts = i2p::util::getTime<std::chrono::seconds> (i2p::util::TimeType::seconds);
if (ts < m_LastSubmissionTime + PUBLISH_MIN_INTERVAL)
{
LogPrint (eLogDebug, "Destination: Publishing LeaseSet is too fast. Wait for ", PUBLISH_MIN_INTERVAL, " seconds");
@ -621,7 +621,7 @@ namespace client
auto request = std::make_shared<LeaseSetRequest> (m_Service);
if (requestComplete)
request->requestComplete.push_back (requestComplete);
auto ts = i2p::util::GetSecondsSinceEpoch ();
auto ts = i2p::util::getTime<std::chrono::seconds> (i2p::util::TimeType::seconds);
auto ret = m_LeaseSetRequests.insert (std::pair<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> >(dest,request));
if (ret.second) // inserted
{
@ -701,7 +701,7 @@ namespace client
if (it != m_LeaseSetRequests.end ())
{
bool done = false;
uint64_t ts = i2p::util::GetSecondsSinceEpoch ();
int64_t ts = i2p::util::getTime<std::chrono::seconds> (i2p::util::TimeType::seconds);
if (ts < it->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT)
{
auto floodfill = i2p::data::netdb.GetClosestFloodfill (dest, it->second->excluded);