mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
eth: fix trie DB reference dereferenced in traceChain, close XFN-85 #1731
This commit is contained in:
parent
e3c4d4923c
commit
26fb93513d
1 changed files with 7 additions and 3 deletions
|
|
@ -356,12 +356,16 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Reference the trie twice, once for us, once for the trancer
|
// Reference the trie twice, once for us, once for the trancer
|
||||||
|
if number < end.NumberU64() { // Skip the last iteration
|
||||||
database.TrieDB().Reference(root, common.Hash{})
|
database.TrieDB().Reference(root, common.Hash{})
|
||||||
if number >= origin {
|
if number >= origin {
|
||||||
database.TrieDB().Reference(root, common.Hash{})
|
database.TrieDB().Reference(root, common.Hash{})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Dereference all past tries we ourselves are done working with
|
// Dereference all past tries we ourselves are done working with
|
||||||
|
if proot != (common.Hash{}) { // Skip the first iteration
|
||||||
database.TrieDB().Dereference(proot)
|
database.TrieDB().Dereference(proot)
|
||||||
|
}
|
||||||
proot = root
|
proot = root
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue