diff --git a/swarm_dial.go b/swarm_dial.go index ab95a4612784c1a52374cb409f26f8cd2b386b9a..29e3a8d70c825568610dca48dddaa3c025618fe0 100644 --- a/swarm_dial.go +++ b/swarm_dial.go @@ -356,7 +356,12 @@ func (s *Swarm) dialWorkerLoop(ctx context.Context, p peer.ID, reqch <-chan dial ad.requests = nil - // if it was a backoff, clear the address dial so that it doesn't inhibit new dial requests + // if it was a backoff, clear the address dial so that it doesn't inhibit new dial requests. + // this is necessary to support active listen scenarios, where a new dial comes in while + // another dial is in progress, and needs to do a direct connection without inhibitions from + // dial backoff. + // it is also necessary to preserve consisent behaviour with the old dialer -- TestDialBackoff + // regresses without this. if err == ErrDialBackoff { delete(pending, ad.addr) }