From 39571745cbb8ce054cb773f2714a20aae0f4a6ef Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 7 May 2021 13:23:49 +0300 Subject: [PATCH] stateroot: fix incompleteRoot leak Drop old incomplete roots from the map. --- pkg/services/stateroot/validators.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/services/stateroot/validators.go b/pkg/services/stateroot/validators.go index 54150270f..e36ba9bd5 100644 --- a/pkg/services/stateroot/validators.go +++ b/pkg/services/stateroot/validators.go @@ -35,6 +35,9 @@ runloop: } else if err := s.signAndSend(r); err != nil { 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: break runloop }