1
0
mirror of https://github.com/veggiedefender/torrent-client.git synced 2025-11-06 09:29:16 +02:00

Super janky download first piece

This commit is contained in:
Jesse
2019-12-22 23:51:31 -05:00
parent 12fac89ce5
commit 7999e23fe1
2 changed files with 92 additions and 7 deletions

View File

@@ -49,9 +49,11 @@ func (t *Torrent) Download() error {
// fmt.Println(peers)
peers := []p2p.Peer{{IP: net.IP{127, 0, 0, 1}, Port: 51413}}
downloader := p2p.Downloader{
Peers: peers,
InfoHash: t.InfoHash,
Length: t.Length,
Peers: peers,
PeerID: peerID,
InfoHash: t.InfoHash,
PieceHashes: t.PieceHashes,
Length: t.Length,
}
err = downloader.Download()
return err