mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-09-26 20:21:26 +08:00
autorelay: refactor relay finder and start autorelay after identify (#2120)
* Refactor relay_finder and start autorelay after identify * Clock fork * Remove multiple timers and use a single rate limiting chan for findNodes * Remove clock fork * Rename * Use scheduledWork.nextAllowedCallToPeerSource.Add(rf.conf.minInterval) * Fix flaky test that relied on time
This commit is contained in:
@@ -433,7 +433,9 @@ func (cfg *Config) NewNode() (host.Host, error) {
|
||||
ho = routed.Wrap(h, router)
|
||||
}
|
||||
if ar != nil {
|
||||
return autorelay.NewAutoRelayHost(ho, ar), nil
|
||||
arh := autorelay.NewAutoRelayHost(ho, ar)
|
||||
arh.Start()
|
||||
ho = arh
|
||||
}
|
||||
return ho, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user