cosmetic: move a method
This commit is contained in:
1 parent
5e6bb8ee67
commit
7a026f5a14
1 file changed
+7
-7
+7
-7
@@ -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
|
// Calculate the routing table from this peer to all peers reachable
|
||||||
// from it, returning a "next hop" map of PeerNameX -> PeerNameY,
|
// from it, returning a "next hop" map of PeerNameX -> PeerNameY,
|
||||||
// which says "in order to send a message to X, the peer should send
|
// 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
|
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 {
|
func StartLocalPeer(name PeerName, router *Router) *LocalPeer {
|
||||||
peer := &LocalPeer{Peer: NewPeer(name, 0, 0), Router: router}
|
peer := &LocalPeer{Peer: NewPeer(name, 0, 0), Router: router}
|
||||||
queryChan := make(chan *PeerInteraction, ChannelSize)
|
queryChan := make(chan *PeerInteraction, ChannelSize)
|
||||||
|
|||||||
Reference in new issue
Block a user