models: properly format port into peerkey string

This commit is contained in:
Jimmy Zelinskie 2015-03-26 22:11:13 -04:00
parent f3b264dd53
commit b93cc26b98

View file

@ -8,6 +8,7 @@ package models
import ( import (
"net" "net"
"strconv"
"strings" "strings"
"time" "time"
@ -104,7 +105,7 @@ func (p *Peer) HasIPv6() bool {
// Key returns a PeerKey for the given peer. // Key returns a PeerKey for the given peer.
func (p *Peer) Key() PeerKey { func (p *Peer) Key() PeerKey {
return NewPeerKey(p.ID, p.IP, string(p.Port)) return NewPeerKey(p.ID, p.IP, strconv.FormatUint(p.Port, 10))
} }
// Torrent is a swarm for a given torrent file. // Torrent is a swarm for a given torrent file.