Skip to content

Commit b9ffbfe

Browse files
apply suggestions from code review
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
1 parent 45da95f commit b9ffbfe

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

waku/discovery/waku_kademlia.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{.push raises: [].}
22

3+
import std/[options, sequtils]
34
import
4-
std/[options, sequtils],
55
chronos,
66
chronicles,
77
results,
@@ -110,7 +110,7 @@ proc extractMixPubKey(service: ServiceInfo): Option[Curve25519Key] =
110110

111111
let key = intoCurve25519Key(service.data)
112112
debug "successfully extracted mix pub key", keyHex = byteutils.toHex(key)
113-
some(key)
113+
return some(key)
114114

115115
proc remotePeerInfoFrom(record: ExtendedPeerRecord): Option[RemotePeerInfo] =
116116
debug "processing kademlia record",
@@ -240,8 +240,8 @@ proc runDiscoveryLoop(
240240
info "found mix peers via targeted kademlia lookup", count = found
241241

242242
await sleepAsync(interval)
243-
except CancelledError:
244-
debug "extended kademlia discovery loop cancelled"
243+
except CancelledError as e:
244+
debug "extended kademlia discovery loop cancelled", error = e.msg
245245
except CatchableError as e:
246246
error "extended kademlia discovery loop failed", error = e.msg
247247

waku/waku_mix/protocol.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ proc processBootNodes(
6262

6363
let mixPubInfo = MixPubInfo.init(peerId, multiAddr, node.pubKey, peerPubKey.skkey)
6464
mix.nodePool.add(mixPubInfo)
65-
count += 1
65+
count.inc()
6666

6767
peermgr.addPeer(
6868
RemotePeerInfo.init(peerId, @[multiAddr], mixPubKey = some(node.pubKey))

0 commit comments

Comments
 (0)