From 6053601c436f1abbf9d71adfcaa43e5939bb671e Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Tue, 19 Sep 2023 17:45:34 +0200 Subject: [PATCH] state: State.MainTreeView also needs to respect v.tx.RLock() --- vochain/state/trees.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vochain/state/trees.go b/vochain/state/trees.go index 2515df6b9..b98742e54 100644 --- a/vochain/state/trees.go +++ b/vochain/state/trees.go @@ -46,6 +46,8 @@ type treeTxWithMutex struct { // MainTreeView is a thread-safe function to obtain a pointer to the last // opened mainTree as a TreeView. func (v *State) MainTreeView() *statedb.TreeView { + v.tx.RLock() + defer v.tx.RUnlock() return v.mainTreeViewValue.Load() }