Add half done idle manamgenet

This commit is contained in:
Zoltán Papp
2025-03-12 10:30:39 +01:00
parent bfe71a3f5a
commit 332b2c5a88
6 changed files with 264 additions and 134 deletions

View File

@@ -91,6 +91,17 @@ func (s *Store) PeerConnOpen(pubKey string) {
p.Open()
}
func (s *Store) PeerConnClose(pubKey string) {
s.peerConnsMu.RLock()
defer s.peerConnsMu.RUnlock()
p, ok := s.peerConns[pubKey]
if !ok {
return
}
p.Close()
}
func (s *Store) PeersPubKey() []string {
s.peerConnsMu.RLock()
defer s.peerConnsMu.RUnlock()