Skip to content

Commit

Permalink
fix(rln-relay): segfault when no params except rln-relay is passed in (
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Sep 25, 2023
1 parent afdcfc7 commit 45fe2d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion waku/waku_rln_relay/group_manager/static/group_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion waku/waku_rln_relay/rln_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 45fe2d3

Please sign in to comment.