From f263be4a743f43bdbc314d706d2f4b4ddf1c8720 Mon Sep 17 00:00:00 2001 From: Prem Chaitanya Prathi Date: Wed, 16 Aug 2023 17:55:58 +0530 Subject: [PATCH] fix: race condition in peermgt initialization reported by race detector (#646) --- waku/v2/node/wakunode2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waku/v2/node/wakunode2.go b/waku/v2/node/wakunode2.go index 2fb68879..946e000e 100644 --- a/waku/v2/node/wakunode2.go +++ b/waku/v2/node/wakunode2.go @@ -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)