aboutsummaryrefslogtreecommitdiffstats
path: root/trie/database.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-08-08 22:16:38 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-09 17:33:30 +0800
commit11bbc660823246b9fc25e4b994121e30a9f17306 (patch)
tree04d6661dd289de85dc66eb29ccb6b9e5083139d5 /trie/database.go
parent8051a0768a2af6c36b04ffa6fb225a45986d9b89 (diff)
downloadgo-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.tar
go-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.tar.gz
go-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.tar.bz2
go-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.tar.lz
go-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.tar.xz
go-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.tar.zst
go-tangerine-11bbc660823246b9fc25e4b994121e30a9f17306.zip
eth, trie: fix tracer GC which accidentally pruned the metaroot
Diffstat (limited to 'trie/database.go')
-rw-r--r--trie/database.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/trie/database.go b/trie/database.go
index 7df45fe2d..d0691b637 100644
--- a/trie/database.go
+++ b/trie/database.go
@@ -431,6 +431,11 @@ func (db *Database) reference(child common.Hash, parent common.Hash) {
// Dereference removes an existing reference from a root node.
func (db *Database) Dereference(root common.Hash) {
+ // Sanity check to ensure that the meta-root is not removed
+ if root == (common.Hash{}) {
+ log.Error("Attempted to dereference the trie cache meta root")
+ return
+ }
db.lock.Lock()
defer db.lock.Unlock()