From 3db4e86564509752393270107967a8b51eb5ef40 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 13 Apr 2015 14:59:32 +0100 Subject: [PATCH] remove established connections from ConnectionMaker state This got broken in 6409a8647c95eb46bc06f5f903ed71739404abd4 The issue is that for successful connections nothing ever sets attempting=false, so we need some other means of removing such entries. --- router/connection_maker.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/router/connection_maker.go b/router/connection_maker.go index c7ea44d0..3de67fcb 100644 --- a/router/connection_maker.go +++ b/router/connection_maker.go @@ -134,8 +134,10 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration { ourConnectedPeers := make(PeerNameSet) ourConnectedTargets := make(map[string]struct{}) for conn := range cm.ourself.Connections() { + address := conn.RemoteTCPAddr() ourConnectedPeers[conn.Remote().Name] = void - ourConnectedTargets[conn.RemoteTCPAddr()] = void + ourConnectedTargets[address] = void + delete(cm.targets, address) } addTarget := func(address string) {