mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +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
|
||||
}
|
||||
// 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{})
|
||||
if number >= origin {
|
||||
database.TrieDB().Reference(root, common.Hash{})
|
||||
}
|
||||
}
|
||||
// Dereference all past tries we ourselves are done working with
|
||||
if proot != (common.Hash{}) { // Skip the first iteration
|
||||
database.TrieDB().Dereference(proot)
|
||||
}
|
||||
proot = root
|
||||
}
|
||||
}()
|
||||
|
|
|
|||
Loading…
Reference in a new issue