From e19173c1f397857de791f14bd6c1c69a178acc47 Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Sun, 30 Oct 2022 08:28:51 +0300 Subject: [PATCH] Prevent new torrent from saving resume data twice PR #17951. --- src/base/bittorrent/sessionimpl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index fc89f85f8..49707a137 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -2753,6 +2753,9 @@ bool SessionImpl::addTorrent_impl(const std::variant &so p.flags |= lt::torrent_flags::duplicate_is_error; + // Prevent torrent from saving initial resume data twice + p.flags &= ~lt::torrent_flags::need_save_resume; + p.added_time = std::time(nullptr); // Limits