]> Sergey Matveev's repositories - btrtrc.git/blobdiff - config.go
Add the DropMutuallyCompletePeers ClientConfig field
[btrtrc.git] / config.go
index f4c0f17239e5b4e95625ebe35fe0a67ffe011f73..0cfde9d0b8916505db748324e6cbf0a3f139dfc2 100644 (file)
--- a/config.go
+++ b/config.go
@@ -124,6 +124,10 @@ type ClientConfig struct {
        // Don't add connections that have the same peer ID as an existing
        // connection for a given Torrent.
        DropDuplicatePeerIds bool
+       // Drop peers that are complete if we are also complete and have no use for the peer. This is a
+       // bit of a special case, since a peer could also be useless if they're just not interested, or
+       // we don't intend to obtain all of a torrent's data.
+       DropMutuallyCompletePeers bool
 
        ConnTracker *conntrack.Instance
 
@@ -170,6 +174,7 @@ func NewDefaultClientConfig() *ClientConfig {
                DownloadRateLimiter:       unlimited,
                ConnTracker:               conntrack.NewInstance(),
                DisableAcceptRateLimiting: true,
+               DropMutuallyCompletePeers: true,
                HeaderObfuscationPolicy: HeaderObfuscationPolicy{
                        Preferred:        true,
                        RequirePreferred: false,