From c891a25d7dafb88664aef479256994ea43261b69 Mon Sep 17 00:00:00 2001 From: sambarnes Date: Mon, 7 Jan 2019 12:07:33 -0600 Subject: [PATCH] FD-785 Added missing mutex usage in FactoidState.GetBalanceHash() --- state/factoidstate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/state/factoidstate.go b/state/factoidstate.go index ebe812e6e2..0abb276e04 100644 --- a/state/factoidstate.go +++ b/state/factoidstate.go @@ -97,8 +97,13 @@ func GetMapHash(dbheight uint32, bmap map[[32]byte]int64) interfaces.IHash { } func (fs *FactoidState) GetBalanceHash(includeTemp bool) interfaces.IHash { + fs.State.ECBalancesPMutex.Lock() + fs.State.FactoidBalancesPMutex.Lock() h1 := GetMapHash(fs.DBHeight, fs.State.FactoidBalancesP) h2 := GetMapHash(fs.DBHeight, fs.State.ECBalancesP) + fs.State.ECBalancesPMutex.Unlock() + fs.State.FactoidBalancesPMutex.Unlock() + h3 := h1 h4 := h2 if includeTemp {