From 854ed5d12db74ab98b547d3c774d241ce58e2454 Mon Sep 17 00:00:00 2001 From: jm-clius Date: Tue, 1 Jun 2021 08:17:42 +0000 Subject: [PATCH] deploy: ee757308c600ed23ccbd978bc99d6126b25c58a4 --- .../vendor/libbacktrace-upstream/libtool | 2 +- waku/v2/protocol/waku_relay.nim | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool index 92c7e2c1b..d54123e2a 100755 --- a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool +++ b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool @@ -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, diff --git a/waku/v2/protocol/waku_relay.nim b/waku/v2/protocol/waku_relay.nim index 650e57499..f5d3ff256 100644 --- a/waku/v2/protocol/waku_relay.nim +++ b/waku/v2/protocol/waku_relay.nim @@ -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)