mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-05-11 21:09:27 +00:00
correct compilation issue
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
75dbeb1be7
commit
55c38c5070
@ -174,14 +174,15 @@ proc addActiveStoreRequest*(pm: PeerManager, peerId: PeerId) {.gcsafe.} =
|
||||
pm.activeStoreRequests.mgetOrPut(peerId, 0).inc()
|
||||
|
||||
proc removeActiveStoreRequest*(pm: PeerManager, peerId: PeerId) {.gcsafe.} =
|
||||
if not pm.activeStoreRequests.contains(peerId):
|
||||
let count = pm.activeStoreRequests.getOrDefault(peerId, 0)
|
||||
if count == 0:
|
||||
return
|
||||
|
||||
let count = pm.activeStoreRequests[peerId] - 1
|
||||
if count <= 0:
|
||||
let newCount = count - 1
|
||||
if newCount <= 0:
|
||||
pm.activeStoreRequests.del(peerId)
|
||||
else:
|
||||
pm.activeStoreRequests[peerId] = count
|
||||
pm.activeStoreRequests[peerId] = newCount
|
||||
|
||||
proc hasActiveStoreRequest*(pm: PeerManager, peerId: PeerId): bool {.gcsafe.} =
|
||||
pm.activeStoreRequests.contains(peerId)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user