@@ -250,23 +250,22 @@ proc lightpushPublish*(
250250 if not node.wakuMix.isNil ():
251251 lmixify = true
252252
253- let
254253 #[ error "failed to publish message using mix as mix protocol is not mounted"
255254 return lighpushErrorResult(
256255 LightPushErrorCode.SERVICE_NOT_AVAILABLE, "Waku lightpush with mix not available"
257256 ) ]#
258- toPeer: RemotePeerInfo = peerOpt.valueOr:
259- if not node.wakuLightPush.isNil ():
260- RemotePeerInfo .init (node.peerId ())
261- elif not node.wakuLightpushClient.isNil ():
262- node.peerManager.selectPeer (WakuLightPushCodec ).valueOr:
263- let msg = " no suitable remote peers"
264- error " failed to publish message" , msg = msg
265- return lighpushErrorResult (LightPushErrorCode .NO_PEERS_TO_RELAY , msg)
266- else :
267- return lighpushErrorResult (
268- LightPushErrorCode .NO_PEERS_TO_RELAY , " no suitable remote peers"
269- )
257+ let toPeer: RemotePeerInfo = peerOpt.valueOr:
258+ if not node.wakuLightPush.isNil ():
259+ RemotePeerInfo .init (node.peerId ())
260+ elif not node.wakuLightpushClient.isNil ():
261+ node.peerManager.selectPeer (WakuLightPushCodec ).valueOr:
262+ let msg = " no suitable remote peers"
263+ error " failed to publish message" , msg = msg
264+ return lighpushErrorResult (LightPushErrorCode .NO_PEERS_TO_RELAY , msg)
265+ else :
266+ return lighpushErrorResult (
267+ LightPushErrorCode .NO_PEERS_TO_RELAY , " no suitable remote peers"
268+ )
270269
271270 let pubsubForPublish = pubSubTopic.valueOr:
272271 if node.wakuAutoSharding.isNone ():
0 commit comments