From 798b4bb57b355d66a94dc1ad2ab7af1520c5ed07 Mon Sep 17 00:00:00 2001 From: gabrielmer <101006718+gabrielmer@users.noreply.github.com> Date: Wed, 26 Feb 2025 18:04:13 +0200 Subject: [PATCH] fix: subscribing to RelaydefaultHandler in libwaku (#3308) --- .../requests/protocols/relay_request.nim | 2 ++ waku/node/waku_node.nim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim b/library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim index 6a940e27e..4f7c8ac5e 100644 --- a/library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim +++ b/library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim @@ -3,6 +3,7 @@ import chronicles, chronos, stew/byteutils, results import ../../../../../waku/waku_core/message/message, ../../../../../waku/factory/[external_config, validator_signed, waku], + ../../../../../waku/waku_node, ../../../../../waku/waku_core/message, ../../../../../waku/waku_core/time, # Timestamp ../../../../../waku/waku_core/topics/pubsub_topic, @@ -105,6 +106,7 @@ proc process*( case self.operation of SUBSCRIBE: # TO DO: properly perform 'subscribe' + waku.node.registerRelayDefaultHandler($self.pubsubTopic) discard waku.node.wakuRelay.subscribe($self.pubsubTopic, self.relayEventCallback) of UNSUBSCRIBE: # TODO: properly perform 'unsubscribe' diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index 5b4f9900f..7ce23914d 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -245,7 +245,7 @@ proc mountStoreSync*( ## Waku relay -proc registerRelayDefaultHandler(node: WakuNode, topic: PubsubTopic) = +proc registerRelayDefaultHandler*(node: WakuNode, topic: PubsubTopic) = if node.wakuRelay.isSubscribed(topic): return