From 681b8c14ad29204da8057d421f935551018797d8 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 26 Aug 2008 06:39:57 +0000 Subject: [PATCH] - Fixed ratio saving for seeding torrents --- src/bittorrent.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 6df4470bf..0119c3c8c 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1393,6 +1393,19 @@ void bittorrent::saveFastResumeAndRatioData() { } saveFastResumeAndRatioData(hash); } + hashes = getFinishedTorrents(); + foreach(hash, hashes) { + QTorrentHandle h = getTorrentHandle(hash); + if(!h.is_valid()) { + qDebug("/!\\ Error: Invalid handle"); + continue; + } + if(h.is_paused()) { + // Do not need to save fast resume data for paused torrents + continue; + } + saveDownloadUploadForTorrent(hash); + } } void bittorrent::saveFastResumeAndRatioData(QString hash) {