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