aboutsummaryrefslogtreecommitdiffstats
path: root/trie/trie.go
diff options
context:
space:
mode:
Diffstat (limited to 'trie/trie.go')
-rw-r--r--trie/trie.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/trie/trie.go b/trie/trie.go
index 139e3d286..d89c39775 100644
--- a/trie/trie.go
+++ b/trie/trie.go
@@ -197,7 +197,12 @@ func (t *Trie) Update(key, value string) {
k := CompactHexDecode(key)
- root := t.UpdateState(t.Root, k, value)
+ var root interface{}
+ if value != "" {
+ root = t.UpdateState(t.Root, k, value)
+ } else {
+ root = t.deleteState(t.Root, k)
+ }
t.setRoot(root)
}