mirror of https://github.com/waku-org/nwaku.git
fix(rln-relay): should error out on rln-relay mount failure (#1904)
This commit is contained in:
parent
78690787fb
commit
8c568cabbe
|
@ -663,8 +663,7 @@ when defined(rln):
|
||||||
info "mounting rln relay"
|
info "mounting rln relay"
|
||||||
|
|
||||||
if node.wakuRelay.isNil():
|
if node.wakuRelay.isNil():
|
||||||
error "WakuRelay protocol is not mounted, cannot mount WakuRlnRelay"
|
raise newException(CatchableError, "WakuRelay protocol is not mounted, cannot mount WakuRlnRelay")
|
||||||
return
|
|
||||||
# TODO: check whether the pubsub topic is supported at the relay level
|
# TODO: check whether the pubsub topic is supported at the relay level
|
||||||
# if rlnConf.rlnRelayPubsubTopic notin node.wakuRelay.defaultPubsubTopics:
|
# if rlnConf.rlnRelayPubsubTopic notin node.wakuRelay.defaultPubsubTopics:
|
||||||
# error "The relay protocol does not support the configured pubsub topic for WakuRlnRelay"
|
# error "The relay protocol does not support the configured pubsub topic for WakuRlnRelay"
|
||||||
|
@ -672,8 +671,7 @@ when defined(rln):
|
||||||
let rlnRelayRes = await WakuRlnRelay.new(rlnConf,
|
let rlnRelayRes = await WakuRlnRelay.new(rlnConf,
|
||||||
registrationHandler)
|
registrationHandler)
|
||||||
if rlnRelayRes.isErr():
|
if rlnRelayRes.isErr():
|
||||||
error "failed to mount WakuRlnRelay", error=rlnRelayRes.error
|
raise newException(CatchableError, "failed to mount WakuRlnRelay: {rlnRelayRes.error}")
|
||||||
return
|
|
||||||
let rlnRelay = rlnRelayRes.get()
|
let rlnRelay = rlnRelayRes.get()
|
||||||
let validator = generateRlnValidator(rlnRelay, spamHandler)
|
let validator = generateRlnValidator(rlnRelay, spamHandler)
|
||||||
let pb = PubSub(node.wakuRelay)
|
let pb = PubSub(node.wakuRelay)
|
||||||
|
|
Loading…
Reference in New Issue