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 /eth | |
parent | 834057592f68eecc45382794c0fed96e594e14d1 (diff) | |
parent | 11bbc660823246b9fc25e4b994121e30a9f17306 (diff) | |
download | dexon-beade042d10df140100c2645fde922cf2c455ef6.tar dexon-beade042d10df140100c2645fde922cf2c455ef6.tar.gz dexon-beade042d10df140100c2645fde922cf2c455ef6.tar.bz2 dexon-beade042d10df140100c2645fde922cf2c455ef6.tar.lz dexon-beade042d10df140100c2645fde922cf2c455ef6.tar.xz dexon-beade042d10df140100c2645fde922cf2c455ef6.tar.zst dexon-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 'eth')
-rw-r--r-- | eth/api_tracer.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 623e5ed1b..722e2a6e3 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -297,7 +297,9 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl database.TrieDB().Reference(root, common.Hash{}) } // Dereference all past tries we ourselves are done working with - database.TrieDB().Dereference(proot) + if proot != (common.Hash{}) { + database.TrieDB().Dereference(proot) + } proot = root // TODO(karalabe): Do we need the preimages? Won't they accumulate too much? @@ -526,7 +528,9 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (* return nil, err } database.TrieDB().Reference(root, common.Hash{}) - database.TrieDB().Dereference(proot) + if proot != (common.Hash{}) { + database.TrieDB().Dereference(proot) + } proot = root } nodes, imgs := database.TrieDB().Size() |