make PeerNameSet a more broadly used type
This commit is contained in:
1 parent
74b3f8d44e
commit
6db12d682e
4 files changed
+4
-4
No files matched your search
@@ -114,7 +114,7 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration {
|
||||
validTarget := make(map[string]struct{})
|
||||
|
||||
// copy the set of things we are connected to, so we can access them without locking
|
||||
ourConnectedPeers := make(map[PeerName]struct{})
|
||||
ourConnectedPeers := make(PeerNameSet)
|
||||
ourConnectedTargets := make(map[string]struct{})
|
||||
for _, conn := range cm.ourself.Connections() {
|
||||
ourConnectedPeers[conn.Remote().Name] = struct{}{}
|
||||
|
||||
@@ -48,7 +48,7 @@ func newMockConnection(from, to *Peer) Connection {
|
||||
}
|
||||
|
||||
func checkEqualConns(t *testing.T, ourName PeerName, got, wanted map[PeerName]Connection) {
|
||||
checkConns := make(map[PeerName]struct{})
|
||||
checkConns := make(PeerNameSet)
|
||||
for _, conn := range wanted {
|
||||
checkConns[conn.Remote().Name] = struct{}{}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ type NameCollisionError struct {
|
||||
Name PeerName
|
||||
}
|
||||
|
||||
type PeerNameSet map[PeerName]struct{}
|
||||
|
||||
func NewPeers(ourself *Peer, onGC func(*Peer)) *Peers {
|
||||
return &Peers{
|
||||
ourself: ourself,
|
||||
|
||||
@@ -350,8 +350,6 @@ func handleSpecialFrame(relayConn *LocalConnection, sender *net.UDPAddr, frame [
|
||||
|
||||
// Gossiper methods - the Router is the topology Gossiper
|
||||
|
||||
type PeerNameSet map[PeerName]struct{}
|
||||
|
||||
type TopologyGossipData struct {
|
||||
peers *Peers
|
||||
update PeerNameSet
|
||||
|
||||
Reference in new issue
Block a user