diff --git a/libi2pd_client/Torrents.cpp b/libi2pd_client/Torrents.cpp index 07776fc6..a201eb97 100644 --- a/libi2pd_client/Torrents.cpp +++ b/libi2pd_client/Torrents.cpp @@ -707,6 +707,7 @@ namespace torrents bool Torrent::UpdateStatus (uint64_t ts) { + if (!m_Length) return false; // non ready magnet bool complete = true; for (auto& it: m_Pieces) { diff --git a/libi2pd_client/TorrentsRPC.cpp b/libi2pd_client/TorrentsRPC.cpp index 0ed6f0b3..aea5387b 100644 --- a/libi2pd_client/TorrentsRPC.cpp +++ b/libi2pd_client/TorrentsRPC.cpp @@ -441,8 +441,9 @@ namespace torrents tracker["lastAnnounceSucceeded"] = false; } tracker["lastAnnounceTimedOut"] = false; // TODO: - tracker["nextAnnounceTime"] = (torrent->GetNextTrackerRequestTime (i) - - i2p::util::GetMonotonicMilliseconds () + i2p::util::GetMillisecondsSinceEpoch ())/1000; + auto nextRequestTime = torrent->GetNextTrackerRequestTime (i); + tracker["nextAnnounceTime"] = ((nextRequestTime ? torrent->GetNextTrackerRequestTime (i) - + i2p::util::GetMonotonicMilliseconds () : 0) + i2p::util::GetMillisecondsSinceEpoch ())/1000; tracker["lastAnnounceTime"] = torrent->GetLastTrackerUpdateTime (i); tracker["lastAnnounceStartTime"] = torrent->GetLastTrackerUpdateTime (i); // TODO: tracker["lastScrapeTime"] = 0;