Browse Source

move the address invalidation check outside the lock

pull/598/head
vyzo 6 years ago
parent
commit
0c69da9409
  1. 5
      p2p/host/relay/autorelay.go

5
p2p/host/relay/autorelay.go

@ -133,12 +133,11 @@ again:
ar.mx.Lock()
haveRelays := len(ar.relays)
if haveRelays >= DesiredRelays {
ar.mx.Unlock()
// this dance is necessary to cover the Private->Public->Private transition
// where we were already connected to enough relays while private and dropped
// the addrs while public
needUpdate := ar.addrs == nil
ar.mx.Unlock()
if needUpdate {
if ar.addrs == nil {
ar.updateAddrs()
}
return

Loading…
Cancel
Save