2
0
mirror of synced 2025-02-24 22:58:28 +00:00

Helper method on Client's Torrent that tells where the metainfo file would be stored

This commit is contained in:
Matt Joiner 2014-12-30 23:58:38 +11:00
parent d54c5ddf24
commit 0810d5a275

View File

@ -1157,6 +1157,8 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
for r := range c.Requests { for r := range c.Requests {
me.connDeleteRequest(t, c, r) me.connDeleteRequest(t, c, r)
} }
// We can then reset our interest.
me.replenishConnRequests(t, c)
case pp.Unchoke: case pp.Unchoke:
c.PeerChoked = false c.PeerChoked = false
me.peerUnchoked(t, c) me.peerUnchoked(t, c)
@ -1621,6 +1623,10 @@ type Torrent struct {
*torrent *torrent
} }
func (t Torrent) MetainfoFilepath() string {
return filepath.Join(t.cl.ConfigDir(), "torrents", t.InfoHash.HexString()+".torrent")
}
func (t Torrent) AddPeers(pp []Peer) error { func (t Torrent) AddPeers(pp []Peer) error {
return t.cl.AddPeers(t.torrent.InfoHash, pp) return t.cl.AddPeers(t.torrent.InfoHash, pp)
} }