From: Matt Joiner <anacrolix@gmail.com>
Date: Mon, 12 Feb 2018 12:49:33 +0000 (+1100)
Subject: tracker: Move Peer into the correct file
X-Git-Tag: v1.0.0~184
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b33ce1e01bc65119391be3b615d839b6954efddc;p=btrtrc.git

tracker: Move Peer into the correct file
---

diff --git a/tracker/peer.go b/tracker/peer.go
index e7718ef6..604d61e2 100644
--- a/tracker/peer.go
+++ b/tracker/peer.go
@@ -4,6 +4,13 @@ import (
 	"net"
 )
 
+type Peer struct {
+	IP   net.IP
+	Port int
+	ID   []byte
+}
+
+// Set from the non-compact form in BEP 3.
 func (p *Peer) fromDictInterface(d map[string]interface{}) {
 	p.IP = net.ParseIP(d["ip"].(string))
 	p.ID = []byte(d["peer id"].(string))
diff --git a/tracker/tracker.go b/tracker/tracker.go
index a2176f51..9ee824c0 100644
--- a/tracker/tracker.go
+++ b/tracker/tracker.go
@@ -2,7 +2,6 @@ package tracker
 
 import (
 	"errors"
-	"net"
 	"net/http"
 	"net/url"
 )
@@ -37,12 +36,6 @@ func (e AnnounceEvent) String() string {
 	return []string{"empty", "completed", "started", "stopped"}[e]
 }
 
-type Peer struct {
-	IP   net.IP
-	Port int
-	ID   []byte
-}
-
 const (
 	None      AnnounceEvent = iota
 	Completed               // The local peer just completed the torrent.