use different contexts for the relay connection lifetime and the Connect() call.
fixes https://github.com/nbd-wtf/go-nostr/pull/86
This commit is contained in:
2
pool.go
2
pool.go
@@ -34,7 +34,7 @@ func (pool *SimplePool) EnsureRelay(url string) (*Relay, error) {
|
||||
defer pool.mutex.Unlock()
|
||||
|
||||
relay, ok := pool.Relays[nm]
|
||||
if ok && relay.ConnectionContext.Err() == nil {
|
||||
if ok && relay.connectionContext.Err() == nil {
|
||||
// already connected, unlock and return
|
||||
return relay, nil
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user