func newRoutes(ourself *localPeer, peers *Peers) *routes {
	recalculate := make(chan *struct{}, 1)
	wait := make(chan chan struct{})
	action := make(chan func())
	r := &routes{
		ourself:      ourself,
		peers:        peers,
		unicast:      unicastRoutes{ourself.Name: UnknownPeerName},
		unicastAll:   unicastRoutes{ourself.Name: UnknownPeerName},
		broadcast:    broadcastRoutes{ourself.Name: []PeerName{}},
		broadcastAll: broadcastRoutes{ourself.Name: []PeerName{}},
		recalc:       recalculate,
		wait:         wait,
		action:       action,
	}
	go r.run(recalculate, wait, action)
	return r
}
func newRoutes(ourself *localPeer, peers *Peers) *routes {
	recalculate := make(chan *struct{}, 1)
	wait := make(chan chan struct{})
	action := make(chan func())
	r := &routes{
		ourself:      ourself,
		peers:        peers,
		unicast:      unicastRoutes{ourself.Name: UnknownPeerName},
		unicastAll:   unicastRoutes{ourself.Name: UnknownPeerName},
		broadcast:    broadcastRoutes{ourself.Name: []PeerName{}},
		broadcastAll: broadcastRoutes{ourself.Name: []PeerName{}},
		recalc:       recalculate,
		wait:         wait,
		action:       action,
	}
	go r.run(recalculate, wait, action)
	return r
}
func newRoutes ( ourself * localPeer , peers * Peers ) * routes { recalculate := make ( chan * struct { } , 1 ) wait := make ( chan chan struct { } ) action := make ( chan func ( ) ) r := & routes { ourself : ourself , peers : peers , unicast : unicastRoutes { ourself . Name : UnknownPeerName } , unicastAll : unicastRoutes { ourself . Name : UnknownPeerName } , broadcast : broadcastRoutes { ourself . Name : [ ] PeerName { } } , broadcastAll : broadcastRoutes { ourself . Name : [ ] PeerName { } } , recalc : recalculate , wait : wait , action : action , } go r . run ( recalculate , wait , action ) return r }
// newRoutes returns a usable Routes based on the LocalPeer and existing Peers.
newRoutes returns a usable Routes based on the LocalPeer and existing Peers .