check if magnet is not ready for status update and tracket info

This commit is contained in:
orignal
2026-09-06 08:35:10 -04:00
parent 0bbfc816a8
commit 19e0586b4a
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -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)
{
+3 -2
View File
@@ -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;