mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 08:57:14 +00:00
deploy: ee757308c600ed23ccbd978bc99d6126b25c58a4
This commit is contained in:
parent
0da251bda3
commit
854ed5d12d
@ -2,7 +2,7 @@
|
||||
|
||||
# libtool - Provide generalized library-building support services.
|
||||
# Generated automatically by config.status (libbacktrace) version-unused
|
||||
# Libtool was configured on host fv-az132-75:
|
||||
# Libtool was configured on host fv-az173-831:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
@ -28,9 +28,15 @@ proc keepAlive*(w: WakuRelay) {.async.} =
|
||||
|
||||
for topic in w.topics.keys:
|
||||
trace "Keepalive on topic", topic=topic
|
||||
let mpeers = w.mesh.getOrDefault(topic)
|
||||
let
|
||||
# Mesh peers for topic
|
||||
mpeers = toSeq(w.mesh.getOrDefault(topic))
|
||||
# Peers we're backing off from on topic
|
||||
backoffPeers = w.backingOff.getOrDefault(topic)
|
||||
# Only keep peers alive that we're not backing off from
|
||||
keepAlivePeers = mpeers.filterIt(not backoffPeers.hasKey(it.peerId))
|
||||
|
||||
w.broadcast(toSeq(mpeers), RPCMsg(control: some(ControlMessage(graft: @[ControlGraft(topicID: topic)]))))
|
||||
w.broadcast(keepAlivePeers, RPCMsg(control: some(ControlMessage(graft: @[ControlGraft(topicID: topic)]))))
|
||||
|
||||
await sleepAsync(DefaultKeepAlive)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user