Helper method on Client's Torrent that tells where the metainfo file would be stored
This commit is contained in:
parent
d54c5ddf24
commit
0810d5a275
@ -1157,6 +1157,8 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
|
||||
for r := range c.Requests {
|
||||
me.connDeleteRequest(t, c, r)
|
||||
}
|
||||
// We can then reset our interest.
|
||||
me.replenishConnRequests(t, c)
|
||||
case pp.Unchoke:
|
||||
c.PeerChoked = false
|
||||
me.peerUnchoked(t, c)
|
||||
@ -1621,6 +1623,10 @@ type Torrent struct {
|
||||
*torrent
|
||||
}
|
||||
|
||||
func (t Torrent) MetainfoFilepath() string {
|
||||
return filepath.Join(t.cl.ConfigDir(), "torrents", t.InfoHash.HexString()+".torrent")
|
||||
}
|
||||
|
||||
func (t Torrent) AddPeers(pp []Peer) error {
|
||||
return t.cl.AddPeers(t.torrent.InfoHash, pp)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user