aboutsummaryrefslogtreecommitdiffstats
path: root/trie/database.go
diff options
context:
space:
mode:
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()