apply suggestions from code review

Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
This commit is contained in:
Prem Chaitanya Prathi 2026-02-11 18:01:18 +05:30
parent 0f1efbab76
commit e8a7559c33
No known key found for this signature in database

View File

@ -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: