From e67fe7a68e5aabbb68a60d95260d556bae823c13 Mon Sep 17 00:00:00 2001 From: kehiy Date: Sat, 20 Jul 2024 11:58:36 +0330 Subject: [PATCH] fix: set lock for PruningHeight --- store/store.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/store/store.go b/store/store.go index fe21977e0..d9f9f181b 100644 --- a/store/store.go +++ b/store/store.go @@ -489,6 +489,9 @@ func (s *store) pruneBlock(blockHeight uint32) (bool, error) { } func (s *store) PruningHeight() uint32 { + s.lk.RLock() + defer s.lk.RUnlock() + cert := s.lastCertificate() if cert == nil { return 0