Skip to content

Commit

Permalink
fix: only set disconnect time on left event (#2831)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer authored Jun 24, 2024
1 parent 733edae commit 0105013
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0105013

Please sign in to comment.