mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-14 15:54:20 +00:00
fix(lightpush): register lightpush protocol when instantiated (#951)
This commit is contained in:
parent
d7c7255aa4
commit
fd4df9221e
@ -53,6 +53,10 @@ func NewWakuLightPush(relay *relay.WakuRelay, pm *peermanager.PeerManager, reg p
|
|||||||
wakuLP.pm = pm
|
wakuLP.pm = pm
|
||||||
wakuLP.metrics = newMetrics(reg)
|
wakuLP.metrics = newMetrics(reg)
|
||||||
|
|
||||||
|
if pm != nil {
|
||||||
|
wakuLP.pm.RegisterWakuProtocol(LightPushID_v20beta1, LightPushENRField)
|
||||||
|
}
|
||||||
|
|
||||||
return wakuLP
|
return wakuLP
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,9 +77,6 @@ func (wakuLP *WakuLightPush) Start(ctx context.Context) error {
|
|||||||
wakuLP.h.SetStreamHandlerMatch(LightPushID_v20beta1, protocol.PrefixTextMatch(string(LightPushID_v20beta1)), wakuLP.onRequest(ctx))
|
wakuLP.h.SetStreamHandlerMatch(LightPushID_v20beta1, protocol.PrefixTextMatch(string(LightPushID_v20beta1)), wakuLP.onRequest(ctx))
|
||||||
wakuLP.log.Info("Light Push protocol started")
|
wakuLP.log.Info("Light Push protocol started")
|
||||||
|
|
||||||
if wakuLP.pm != nil {
|
|
||||||
wakuLP.pm.RegisterWakuProtocol(LightPushID_v20beta1, LightPushENRField)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user