mirror of
https://github.com/waku-org/nwaku.git
synced 2025-02-24 12:58:35 +00:00
fix: only set disconnect time on left event (#2831)
This commit is contained in:
parent
733edae435
commit
01050138c6
@ -442,7 +442,9 @@ proc onPeerEvent(pm: PeerManager, peerId: PeerId, event: PeerEvent) {.async.} =
|
||||
|
||||
if not pm.storage.isNil:
|
||||
var remotePeerInfo = pm.peerStore.get(peerId)
|
||||
remotePeerInfo.disconnectTime = getTime().toUnix
|
||||
|
||||
if event.kind == PeerEventKind.Left:
|
||||
remotePeerInfo.disconnectTime = getTime().toUnix
|
||||
|
||||
pm.storage.insertOrReplace(remotePeerInfo)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user