Browse Source

Woops, broke LastSeen

Jakob Borg 11 years ago
parent
commit
f680a63a1f
1 changed files with 5 additions and 3 deletions
  1. 5 3
      model/model.go

+ 5 - 3
model/model.go

@@ -573,10 +573,12 @@ func (cf cFiler) CurrentFile(file string) protocol.FileInfo {
 // ConnectedTo returns true if we are connected to the named node.
 func (m *Model) ConnectedTo(nodeID protocol.NodeID) bool {
 	m.pmut.RLock()
-	if statRef, ok := m.nodeStatRefs[nodeID]; ok {
-		statRef.WasSeen()
-	}
 	_, ok := m.protoConn[nodeID]
+	if ok {
+		if statRef, ok := m.nodeStatRefs[nodeID]; ok {
+			statRef.WasSeen()
+		}
+	}
 	m.pmut.RUnlock()
 	return ok
 }