mirror of https://github.com/waku-org/nwaku.git
fix(rln-relay): segfault when no params except rln-relay is passed in (#2047)
This commit is contained in:
parent
afdcfc78b9
commit
45fe2d3bee
|
@ -19,7 +19,8 @@ method init*(g: StaticGroupManager): Future[void] {.async,gcsafe.} =
|
|||
let
|
||||
groupSize = g.groupSize
|
||||
groupKeys = g.groupKeys
|
||||
membershipIndex = g.membershipIndex.get()
|
||||
membershipIndex = if g.membershipIndex.isSome(): g.membershipIndex.get()
|
||||
else: raise newException(ValueError, "Membership index is not set")
|
||||
|
||||
if membershipIndex < MembershipIndex(0) or membershipIndex >= MembershipIndex(groupSize):
|
||||
raise newException(ValueError, "Invalid membership index. Must be within 0 and " & $(groupSize - 1) & "but was " & $membershipIndex)
|
||||
|
|
|
@ -408,7 +408,7 @@ proc isReady*(rlnPeer: WakuRLNRelay): Future[bool] {.async.} =
|
|||
|
||||
proc new*(T: type WakuRlnRelay,
|
||||
conf: WakuRlnConfig,
|
||||
registrationHandler: Option[RegistrationHandler] = none(RegistrationHandler)
|
||||
registrationHandler = none(RegistrationHandler)
|
||||
): Future[RlnRelayResult[WakuRlnRelay]] {.async.} =
|
||||
## Mounts the rln-relay protocol on the node.
|
||||
## The rln-relay protocol can be mounted in two modes: on-chain and off-chain.
|
||||
|
|
Loading…
Reference in New Issue