Skip to content

Commit fd4df92

Browse files
fix(lightpush): register lightpush protocol when instantiated (#951)
1 parent d7c7255 commit fd4df92

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

waku/v2/protocol/lightpush/waku_lightpush.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ func NewWakuLightPush(relay *relay.WakuRelay, pm *peermanager.PeerManager, reg p
5353
wakuLP.pm = pm
5454
wakuLP.metrics = newMetrics(reg)
5555

56+
if pm != nil {
57+
wakuLP.pm.RegisterWakuProtocol(LightPushID_v20beta1, LightPushENRField)
58+
}
59+
5660
return wakuLP
5761
}
5862

@@ -73,9 +77,6 @@ func (wakuLP *WakuLightPush) Start(ctx context.Context) error {
7377
wakuLP.h.SetStreamHandlerMatch(LightPushID_v20beta1, protocol.PrefixTextMatch(string(LightPushID_v20beta1)), wakuLP.onRequest(ctx))
7478
wakuLP.log.Info("Light Push protocol started")
7579

76-
if wakuLP.pm != nil {
77-
wakuLP.pm.RegisterWakuProtocol(LightPushID_v20beta1, LightPushENRField)
78-
}
7980
return nil
8081
}
8182

0 commit comments

Comments
 (0)