mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-03-30 16:33:10 +00:00
fix lint errors
This commit is contained in:
parent
b943ece443
commit
ab123e4843
@ -494,7 +494,10 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =
|
||||
),
|
||||
node.peerManager,
|
||||
getMixNodePoolSize = proc(): int {.gcsafe, raises: [].} =
|
||||
if node.wakuMix.isNil(): 0 else: node.getMixNodePoolSize(),
|
||||
if node.wakuMix.isNil():
|
||||
0
|
||||
else:
|
||||
node.getMixNodePoolSize(),
|
||||
isNodeStarted = proc(): bool {.gcsafe, raises: [].} =
|
||||
node.started,
|
||||
).valueOr:
|
||||
|
||||
@ -82,13 +82,15 @@ proc new*(
|
||||
info "kademlia discovery created",
|
||||
bootstrapNodes = params.bootstrapNodes.len, advertiseMix = params.advertiseMix
|
||||
|
||||
ok(WakuKademlia(
|
||||
protocol: kademlia,
|
||||
peerManager: peerManager,
|
||||
running: false,
|
||||
getMixNodePoolSize: getMixNodePoolSize,
|
||||
isNodeStarted: isNodeStarted,
|
||||
))
|
||||
ok(
|
||||
WakuKademlia(
|
||||
protocol: kademlia,
|
||||
peerManager: peerManager,
|
||||
running: false,
|
||||
getMixNodePoolSize: getMixNodePoolSize,
|
||||
isNodeStarted: isNodeStarted,
|
||||
)
|
||||
)
|
||||
|
||||
proc extractMixPubKey(service: ServiceInfo): Option[Curve25519Key] =
|
||||
if service.id != MixProtocolID:
|
||||
@ -151,7 +153,9 @@ proc remotePeerInfoFrom(record: ExtendedPeerRecord): Option[RemotePeerInfo] =
|
||||
)
|
||||
)
|
||||
|
||||
proc lookupMixPeers*(wk: WakuKademlia): Future[Result[int, string]] {.async: (raises: []).} =
|
||||
proc lookupMixPeers*(
|
||||
wk: WakuKademlia
|
||||
): Future[Result[int, string]] {.async: (raises: []).} =
|
||||
## Lookup mix peers via kademlia and add them to the peer store.
|
||||
## Returns the number of mix peers found and added.
|
||||
if wk.protocol.isNil():
|
||||
@ -185,9 +189,7 @@ proc lookupMixPeers*(wk: WakuKademlia): Future[Result[int, string]] {.async: (ra
|
||||
return ok(added)
|
||||
|
||||
proc runDiscoveryLoop(
|
||||
wk: WakuKademlia,
|
||||
interval: Duration,
|
||||
minMixPeers: int,
|
||||
wk: WakuKademlia, interval: Duration, minMixPeers: int
|
||||
) {.async: (raises: []).} =
|
||||
info "extended kademlia discovery loop started", interval = interval
|
||||
|
||||
|
||||
@ -188,7 +188,10 @@ proc setupProtocols(
|
||||
),
|
||||
node.peerManager,
|
||||
getMixNodePoolSize = proc(): int {.gcsafe, raises: [].} =
|
||||
if node.wakuMix.isNil(): 0 else: node.getMixNodePoolSize(),
|
||||
if node.wakuMix.isNil():
|
||||
0
|
||||
else:
|
||||
node.getMixNodePoolSize(),
|
||||
isNodeStarted = proc(): bool {.gcsafe, raises: [].} =
|
||||
node.started,
|
||||
).valueOr:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user