try to reconnect even if the first connection failed.

fixes https://github.com/nbd-wtf/go-nostr/issues/193
This commit is contained in:
fiatjaf
2025-10-22 07:50:58 -03:00
parent fa43cf6a67
commit 493d69bb5e

View File

@@ -445,7 +445,6 @@ func (pool *SimplePool) subMany(
}
eosed := atomic.Bool{}
firstConnection := true
go func(nm string) {
defer func() {
@@ -484,16 +483,10 @@ func (pool *SimplePool) subMany(
relay, err := pool.EnsureRelay(nm)
if err != nil {
// if we never connected to this just fail
if firstConnection {
return
}
// otherwise (if we were connected and got disconnected) keep trying to reconnect
debugLogf("%s reconnecting because connection failed\n", nm)
goto reconnect
}
firstConnection = false
hasAuthed = false
subscribe: