Lock seenBlocks on cleanupSeenBlocks method
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2023-05-24 09:14:27 +02:00
parent 009e507d5d
commit 52b2d617c0
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -840,6 +840,9 @@ func (c *SideChain) pruneOldBlocks() {
}
func (c *SideChain) cleanupSeenBlocks() (cleaned int) {
c.seenBlocksLock.Lock()
defer c.seenBlocksLock.Unlock()
for k, _ := range c.seenBlocks {
if c.getPoolBlockByTemplateId(k.TemplateId()) == nil {
delete(c.seenBlocks, k)