5
5
"crypto/sha1"
6
6
//"errors"
7
7
"fmt"
8
- // "github.com/anacrolix/missinggo/slices"
8
+ "github.com/anacrolix/missinggo/slices"
9
9
"github.com/bradfitz/iter"
10
10
"github.com/edsrzf/mmap-go"
11
11
"io"
@@ -495,9 +495,9 @@ func (tm *TorrentManager) AddTorrent(filePath string, BytesRequested int64) *Tor
495
495
if err != nil {
496
496
return nil
497
497
}
498
- // var ss []string
499
- // slices.MakeInto(&ss, mi.Nodes)
500
- // tm.client.AddDHTNodes(ss)
498
+ var ss []string
499
+ slices .MakeInto (& ss , mi .Nodes )
500
+ tm .client .AddDHTNodes (ss )
501
501
<- t .GotInfo ()
502
502
t .VerifyData ()
503
503
torrent := tm .CreateTorrent (t , BytesRequested , torrentPending , ih )
@@ -512,9 +512,9 @@ func (tm *TorrentManager) AddTorrent(filePath string, BytesRequested int64) *Tor
512
512
if err != nil {
513
513
return nil
514
514
}
515
- // var ss []string
516
- // slices.MakeInto(&ss, mi.Nodes)
517
- // tm.client.AddDHTNodes(ss)
515
+ var ss []string
516
+ slices .MakeInto (& ss , mi .Nodes )
517
+ tm .client .AddDHTNodes (ss )
518
518
<- t .GotInfo ()
519
519
t .VerifyData ()
520
520
torrent := tm .CreateTorrent (t , BytesRequested , torrentPending , ih )
@@ -825,18 +825,16 @@ func (tm *TorrentManager) listenTorrentProgress() {
825
825
t .bytesMissing = t .BytesMissing ()
826
826
827
827
if t .Finished () {
828
- err := os .Symlink (
828
+ os .Symlink (
829
829
path .Join (defaultTmpFilePath , t .InfoHash ()),
830
830
path .Join (tm .DataDir , t .InfoHash ()),
831
831
)
832
- if err == nil {
833
- delete (tm .activeTorrents , ih )
834
- tm .seedingTorrents [ih ] = t
835
- t .Seed ()
836
- t .loop = defaultSeedInterval / queryTimeInterval
837
- total_size += uint64 (t .bytesCompleted )
838
- current_size += uint64 (t .bytesCompleted )
839
- }
832
+ delete (tm .activeTorrents , ih )
833
+ tm .seedingTorrents [ih ] = t
834
+ t .Seed ()
835
+ t .loop = defaultSeedInterval / queryTimeInterval
836
+ total_size += uint64 (t .bytesCompleted )
837
+ current_size += uint64 (t .bytesCompleted )
840
838
continue
841
839
}
842
840
0 commit comments