diff --git a/connection_maker.go b/connection_maker.go index 0e4c04e7..77845ce8 100644 --- a/connection_maker.go +++ b/connection_maker.go @@ -85,7 +85,6 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio } switch { case query.code == CMEnsure: - log.Println("Connection ensure", query.address) cm.addToTargets(query.acceptAnyPeer, query.address) cm.resetTarget(query.address) tickNow() @@ -94,7 +93,6 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio case query.code == CMEstablished: target := cm.targets[query.address] if target != nil { - log.Println("Connection established to", query.address, target) target.state = CSEstablished } else { log.Fatal("Connection established to unknown address", query.address) @@ -110,9 +108,9 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio case now := <-tick: for address, target := range cm.targets { if target.state == CSUnconnected && now.After(target.tryAfter) { - /*if _, found := cm.router.Ourself.ConnectionOn(address); found { + if _, found := cm.router.Ourself.ConnectionOn(address); found { target.state = CSEstablished - } else*/ { + } else { target.attemptCount += 1 target.state = CSAttempting go cm.attemptConnection(address, target.acceptAnyPeer)