mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
Fix error in removing recent roots not checking AcceptableWindowSize
This commit is contained in:
parent
65494a9777
commit
6d76942950
@ -275,12 +275,10 @@ proc updateRoots*(g: OnchainGroupManager): Future[bool] {.async.} =
|
||||
debug "adding new recent root", root = r
|
||||
g.validRoots.addLast(r)
|
||||
|
||||
var removed = 0
|
||||
let addCount = toAdd.len
|
||||
while removed < addCount and g.validRoots.len > 0:
|
||||
# Only trim the deque if it exceeds the acceptable window size
|
||||
while g.validRoots.len > AcceptableRootWindowSize:
|
||||
debug "removing old recent root", root = g.validRoots[0]
|
||||
discard g.validRoots.popFirst()
|
||||
inc removed
|
||||
|
||||
return true
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user