refactor(ish): obtain local connection status from CM alone
This commit is contained in:
1 parent
f8b074f696
commit
fc6f3993bd
1 file changed
+2
-2
+2
-2
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user