aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-24 23:47:01 +0800
committerobscuren <geffobscura@gmail.com>2014-09-24 23:47:01 +0800
commitad13b402d715e120009b3efb6a08d2c90139f31d (patch)
tree631909593ca57f97297482caf3eabe22d4bcea6f
parentba43364f36db690528cc62196969414ef5e98833 (diff)
downloaddexon-ad13b402d715e120009b3efb6a08d2c90139f31d.tar
dexon-ad13b402d715e120009b3efb6a08d2c90139f31d.tar.gz
dexon-ad13b402d715e120009b3efb6a08d2c90139f31d.tar.bz2
dexon-ad13b402d715e120009b3efb6a08d2c90139f31d.tar.lz
dexon-ad13b402d715e120009b3efb6a08d2c90139f31d.tar.xz
dexon-ad13b402d715e120009b3efb6a08d2c90139f31d.tar.zst
dexon-ad13b402d715e120009b3efb6a08d2c90139f31d.zip
Fixed race condition
-rw-r--r--ethtrie/trie.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ethtrie/trie.go b/ethtrie/trie.go
index e6e09dd0d..695ff436a 100644
--- a/ethtrie/trie.go
+++ b/ethtrie/trie.go
@@ -196,8 +196,8 @@ func (t *Trie) Update(key, value string) {
}
func (t *Trie) Get(key string) string {
- t.mut.RLock()
- defer t.mut.RUnlock()
+ t.mut.Lock()
+ defer t.mut.Unlock()
k := CompactHexDecode(key)
c := ethutil.NewValue(t.getState(t.Root, k))