diff --git a/waku/discovery/waku_ext_kademlia.nim b/waku/discovery/waku_ext_kademlia.nim index e5a1d5fc5..cd3598bd8 100644 --- a/waku/discovery/waku_ext_kademlia.nim +++ b/waku/discovery/waku_ext_kademlia.nim @@ -77,9 +77,6 @@ proc extractMixPubKey(service: ServiceInfo): Option[Curve25519Key] = serviceId = service.id, mixProtocolId = MixProtocolID return none(Curve25519Key) - debug "found mix protocol service", - dataLen = service.data.len, expectedLen = Curve25519KeySize - if service.data.len != Curve25519KeySize: warn "invalid mix pub key length from kademlia record", expected = Curve25519KeySize, @@ -87,6 +84,9 @@ proc extractMixPubKey(service: ServiceInfo): Option[Curve25519Key] = dataHex = service.data.toHex() return none(Curve25519Key) + debug "found mix protocol service", + dataLen = service.data.len, expectedLen = Curve25519KeySize + let key = intoCurve25519Key(service.data) debug "successfully extracted mix pub key", keyHex = key.toHex() some(key) @@ -167,11 +167,11 @@ proc lookupMixPeers*(node: WakuNode): Future[int] {.async.} = info "mix peer lookup complete", found = added return added -proc runExtendedKademliaDiscoveryLoop*( +proc runExtendedKademliaDiscoveryLoop( node: WakuNode, interval = DefaultExtendedKademliaDiscoveryInterval, minMixPeers: int = 0, -): Future[void] {.async.} = +): {.async.} = info "extended kademlia discovery loop started", interval = interval try: