stateroot: fix incompleteRoot leak

Drop old incomplete roots from the map.
This commit is contained in:
Roman Khimov 2021-05-07 13:23:49 +03:00
parent 3d49f7d99a
commit 39571745cb

View file

@ -35,6 +35,9 @@ runloop:
} else if err := s.signAndSend(r); err != nil { } else if err := s.signAndSend(r); err != nil {
s.log.Error("can't sign or send state root", zap.Error(err)) s.log.Error("can't sign or send state root", zap.Error(err))
} }
s.srMtx.Lock()
delete(s.incompleteRoots, b.Index-voteValidEndInc)
s.srMtx.Unlock()
case <-s.done: case <-s.done:
break runloop break runloop
} }