Skip to content

Commit

Permalink
fix(daemon): try to connect to all stored peers periodically
Browse files Browse the repository at this point in the history
  • Loading branch information
juligasa committed Sep 27, 2024
1 parent 2867520 commit 2b794c0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/syncing/syncing.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func (s *Service) refreshWorkers(ctx context.Context) error {
if err != nil {
return err
}
defer release()
if err = sqlitex.Exec(conn, qListPeersWithPid(), func(stmt *sqlite.Stmt) error {
addresStr := stmt.ColumnText(0)
pid := stmt.ColumnText(1)
Expand All @@ -235,15 +234,14 @@ func (s *Service) refreshWorkers(ctx context.Context) error {
s.log.Warn("Can't periodically sync with peer because it has malformed addresses", zap.String("PID", pid), zap.Error(err))
return nil
}
if s.host.Network().Connectedness(info.ID) != network.Connected {
return nil
}
s.host.Peerstore().AddAddrs(info.ID, info.Addrs, peerstore.TempAddrTTL)
peers[info.ID] = struct{}{}
return nil
}); err != nil {
release()
return err
}
release()

var workersDiff int

Expand Down

0 comments on commit 2b794c0

Please sign in to comment.