mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-02-13 10:23:08 +00:00
apply suggestions from code review
Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
This commit is contained in:
parent
0f1efbab76
commit
e8a7559c33
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user