fix: subscribing to RelaydefaultHandler in libwaku (#3308)

This commit is contained in:
gabrielmer 2025-02-26 18:04:13 +02:00 committed by GitHub
parent a1901a044e
commit 798b4bb57b
2 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import chronicles, chronos, stew/byteutils, results
import import
../../../../../waku/waku_core/message/message, ../../../../../waku/waku_core/message/message,
../../../../../waku/factory/[external_config, validator_signed, waku], ../../../../../waku/factory/[external_config, validator_signed, waku],
../../../../../waku/waku_node,
../../../../../waku/waku_core/message, ../../../../../waku/waku_core/message,
../../../../../waku/waku_core/time, # Timestamp ../../../../../waku/waku_core/time, # Timestamp
../../../../../waku/waku_core/topics/pubsub_topic, ../../../../../waku/waku_core/topics/pubsub_topic,
@ -105,6 +106,7 @@ proc process*(
case self.operation case self.operation
of SUBSCRIBE: of SUBSCRIBE:
# TO DO: properly perform 'subscribe' # TO DO: properly perform 'subscribe'
waku.node.registerRelayDefaultHandler($self.pubsubTopic)
discard waku.node.wakuRelay.subscribe($self.pubsubTopic, self.relayEventCallback) discard waku.node.wakuRelay.subscribe($self.pubsubTopic, self.relayEventCallback)
of UNSUBSCRIBE: of UNSUBSCRIBE:
# TODO: properly perform 'unsubscribe' # TODO: properly perform 'unsubscribe'

View File

@ -245,7 +245,7 @@ proc mountStoreSync*(
## Waku relay ## Waku relay
proc registerRelayDefaultHandler(node: WakuNode, topic: PubsubTopic) = proc registerRelayDefaultHandler*(node: WakuNode, topic: PubsubTopic) =
if node.wakuRelay.isSubscribed(topic): if node.wakuRelay.isSubscribed(topic):
return return