Fix returns when iterating over Connections()

d5eb76f32 replaced (*Peer)ForEachConnection into (*Peer)Connections(),
and consequently converted some nested functions into for loops.  But
the "return" statements in those nested functions were left as-was,
and so exited the outer function rather than moving on to the next
iteration.

Fixes #497
This commit is contained in:
David Wragg committed 2015-03-29 19:10:44 +01:00
1 parent d708cb7d4e
commit b00be096f7
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -136,7 +136,7 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration {
for _, conn := range peer.Connections() {
otherPeer := conn.Remote().Name
if otherPeer == cm.ourself.Name || ourConnectedPeers[otherPeer] {
return
continue
}
address := conn.RemoteTCPAddr()
// try both portnumber of connection and standard port. Don't use remote side of inbound connection.