refactor(ish): obtain local connection status from CM alone

This commit is contained in:
Matthias Radestock committed 2015-09-30 14:00:32 +01:00
1 parent f8b074f696
commit fc6f3993bd
1 file changed
+2 -2
+2 -2
View File
@@ -171,12 +171,12 @@ func NewLocalConnectionStatusSlice(cm *ConnectionMaker) []LocalConnectionStatus
resultChan := make(chan []LocalConnectionStatus, 0) resultChan := make(chan []LocalConnectionStatus, 0)
cm.actionChan <- func() bool { cm.actionChan <- func() bool {
var slice []LocalConnectionStatus var slice []LocalConnectionStatus
for conn := range cm.ourself.Connections() { for address, conn := range cm.connections {
state := "pending" state := "pending"
if conn.Established() { if conn.Established() {
state = "established" state = "established"
} }
slice = append(slice, LocalConnectionStatus{conn.RemoteTCPAddr(), conn.Outbound(), state, conn.Remote().String()}) slice = append(slice, LocalConnectionStatus{address, conn.Outbound(), state, conn.Remote().String()})
} }
for address, target := range cm.targets { for address, target := range cm.targets {
var state, info string var state, info string