diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-08-09 17:35:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 17:35:12 +0800 |
commit | beade042d10df140100c2645fde922cf2c455ef6 (patch) | |
tree | 56c99350c9ff21c322f66e399612929a8d7b17e4 /trie | |
parent | 834057592f68eecc45382794c0fed96e594e14d1 (diff) | |
parent | 11bbc660823246b9fc25e4b994121e30a9f17306 (diff) | |
download | go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.tar go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.tar.gz go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.tar.bz2 go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.tar.lz go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.tar.xz go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.tar.zst go-tangerine-beade042d10df140100c2645fde922cf2c455ef6.zip |
Merge pull request #17357 from karalabe/tracer-trie-deref-bug
eth, trie: fix tracer GC which accidentally pruned the metaroot
Diffstat (limited to 'trie')
-rw-r--r-- | trie/database.go | 5 |
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() |