fix: race condition in peermgt initialization reported by race detector (#646)

This commit is contained in:
Prem Chaitanya Prathi 2023-08-16 17:55:58 +05:30 committed by GitHub
parent d860d825c1
commit f263be4a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -384,6 +384,7 @@ func (w *WakuNode) Start(ctx context.Context) error {
}
w.peerConnector.SetHost(host)
w.peermanager.SetHost(host)
w.peerConnector.SetPeerManager(w.peermanager)
err = w.peerConnector.Start(ctx)
if err != nil {
@ -398,7 +399,6 @@ func (w *WakuNode) Start(ctx context.Context) error {
}
w.relay.SetHost(host)
w.peermanager.SetHost(host)
if w.opts.enableRelay {
err := w.relay.Start(ctx)