From 8bd59148d9f3738d8ce9575798d649ae9012b77d Mon Sep 17 00:00:00 2001 From: DarshanBPatel Date: Tue, 9 Jul 2024 12:41:26 +0530 Subject: [PATCH] chore: update the pr --- waku/node/peer_manager/waku_peer_store.nim | 3 ++- waku/waku_peer_exchange/protocol.nim | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/waku/node/peer_manager/waku_peer_store.nim b/waku/node/peer_manager/waku_peer_store.nim index 5f5c4b17a0..2355090ee6 100644 --- a/waku/node/peer_manager/waku_peer_store.nim +++ b/waku/node/peer_manager/waku_peer_store.nim @@ -3,6 +3,7 @@ import std/[tables, sequtils, sets, options, strutils, times, random, math], chronos, + chronos/timer, eth/p2p/discoveryv5/enr, libp2p/builders, libp2p/peerstore @@ -144,7 +145,7 @@ proc getPeersByProtocol*(peerStore: PeerStore, proto: string): seq[RemotePeerInf return peerStore.peers.filterIt(it.protocols.contains(proto)) proc getReachablePeers*(peerStore: PeerStore): seq[RemotePeerInfo] = - let threshold = Moment.fromNow(initDuration(hours = 3)) + let threshold = Moment.fromNow(millis(2*60*60*1000)) return peerStore.peers.filterIt( (it.connectedness == CanConnect or it.connectedness == Connected) and (it.lastSuccessfulConn < threshold) diff --git a/waku/waku_peer_exchange/protocol.nim b/waku/waku_peer_exchange/protocol.nim index b893b83031..7fdb69ea11 100644 --- a/waku/waku_peer_exchange/protocol.nim +++ b/waku/waku_peer_exchange/protocol.nim @@ -116,7 +116,6 @@ proc respond( proc getEnrsFromCache( wpx: WakuPeerExchange, numPeers: uint64 ): seq[enr.Record] {.gcsafe.} = - wpx.updatePxEnrCache() if wpx.enrCache.len() == 0: debug "peer exchange ENR cache is empty" return @[]