cosmetic: move a method

This commit is contained in:
Matthias Radestock committed 2014-12-25 13:57:49 +00:00
1 parent 5e6bb8ee67
commit 7a026f5a14
1 file changed
+7 -7
+7 -7
View File
@@ -70,6 +70,13 @@ func (peer *Peer) ForEachConnection(fun func(PeerName, Connection)) {
}
}
func (peer *Peer) SetVersionAndConnections(version uint64, connections map[PeerName]Connection) {
peer.Lock()
defer peer.Unlock()
peer.version = version
peer.connections = connections
}
// Calculate the routing table from this peer to all peers reachable
// from it, returning a "next hop" map of PeerNameX -> PeerNameY,
// which says "in order to send a message to X, the peer should send
@@ -137,13 +144,6 @@ func (peer *Peer) Routes(stopAt *Peer, symmetric bool) (bool, map[PeerName]PeerN
return false, routes
}
func (peer *Peer) SetVersionAndConnections(version uint64, connections map[PeerName]Connection) {
peer.Lock()
defer peer.Unlock()
peer.version = version
peer.connections = connections
}
func StartLocalPeer(name PeerName, router *Router) *LocalPeer {
peer := &LocalPeer{Peer: NewPeer(name, 0, 0), Router: router}
queryChan := make(chan *PeerInteraction, ChannelSize)