a better way to clean up after established connections

...than 3db4e86
This commit is contained in:
Matthias Radestock committed 2015-09-30 14:00:32 +01:00
1 parent 66f14099ed
commit f8b074f696
1 file changed
+5 -2
+5 -2
View File
@@ -99,7 +99,11 @@ func (cm *ConnectionMaker) ConnectionAborted(address string, err error) {
func (cm *ConnectionMaker) ConnectionCreated(conn Connection) {
cm.actionChan <- func() bool {
cm.connections[conn.RemoteTCPAddr()] = conn
address := conn.RemoteTCPAddr()
cm.connections[address] = conn
if conn.Outbound() {
delete(cm.targets, address)
}
return false
}
}
@@ -189,7 +193,6 @@ func (cm *ConnectionMaker) ourConnections() (PeerNameSet, map[string]struct{}) {
ourInboundIPs = make(map[string]struct{})
)
for address, conn := range cm.connections {
delete(cm.targets, address)
ourConnectedPeers[conn.Remote().Name] = void
if conn.Outbound() {
continue