From: Samuel Date: Sun, 5 Nov 2017 03:04:33 +0000 (+0000) Subject: Aggressive Upload (#203) X-Git-Tag: v1.0.0~354 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3e74396c664a20648e35ed7463318578baaa0ed2;p=btrtrc.git Aggressive Upload (#203) * Aggressive Upload Config * Aggressive Upload * Flip config option. * Flip Aggressive Upload Config Option --- diff --git a/config.go b/config.go index 008a0ad0..c0abb23e 100644 --- a/config.go +++ b/config.go @@ -27,6 +27,8 @@ type Config struct { // Never send chunks to peers. NoUpload bool `long:"no-upload"` + // Disable uploading even when it isn't fair. + DisableAggressiveUpload bool `long:"disable-aggressive-upload"` // Upload even after there's nothing in it for us. By default uploading is // not altruistic, we'll upload slightly more than we download from each // peer. diff --git a/torrent.go b/torrent.go index 3591467f..0e4d0021 100644 --- a/torrent.go +++ b/torrent.go @@ -1176,7 +1176,7 @@ func (t *Torrent) seeding() bool { if !cl.config.Seed { return false } - if t.needData() { + if cl.config.DisableAggressiveUpload && t.needData() { return false } return true