From 25233295ba2cdf38339802769699ad05736ea0cb Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 26 Aug 2008 06:45:24 +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 72d2357ab..e1a60a283 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -933,6 +933,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) {