exclude non-established connections from broadcast routing
We already excluded such connections from unicast routing. Fixes #452.
This commit is contained in:
1 parent
6f89ead9bd
commit
1ceb041bc5
1 file changed
+7
-1
+7
-1
@@ -137,11 +137,17 @@ func (routes *Routes) calculateBroadcast() map[PeerName][]PeerName {
|
||||
routes.peers.ForEach(func(name PeerName, peer *Peer) {
|
||||
hops := []PeerName{}
|
||||
if found, reached := peer.Routes(ourself, true); found {
|
||||
// This is rather similar to the inner loop on
|
||||
// peer.Routes(...); the main difference is in the
|
||||
// locking.
|
||||
ourself.ForEachConnection(func(remoteName PeerName, conn Connection) {
|
||||
if !conn.Established() {
|
||||
return
|
||||
}
|
||||
if _, found := reached[remoteName]; found {
|
||||
return
|
||||
}
|
||||
if _, found := conn.Remote().ConnectionTo(ourself.Name); found {
|
||||
if remoteConn, found := conn.Remote().ConnectionTo(ourself.Name); found && remoteConn.Established() {
|
||||
hops = append(hops, remoteName)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user