mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
fix
This commit is contained in:
parent
82fa9a4268
commit
8f3f0ab650
1 changed files with 6 additions and 3 deletions
|
|
@ -63,12 +63,15 @@ func (s *WitnessStats) Add(nodes map[string][]byte, owner common.Hash) {
|
|||
// The last path is always a leaf.
|
||||
if i == len(paths)-1 || !strings.HasPrefix(paths[i+1], paths[i]) {
|
||||
depth := len(path)
|
||||
if owner == (common.Hash{}) {
|
||||
if depth >= len(s.accountTrieLeaves) {
|
||||
depth = len(s.accountTrieLeaves) - 1
|
||||
}
|
||||
if owner == (common.Hash{}) {
|
||||
s.accountTrieLeaves[depth] += 1
|
||||
} else {
|
||||
if depth >= len(s.storageTrieLeaves) {
|
||||
depth = len(s.storageTrieLeaves) - 1
|
||||
}
|
||||
s.storageTrieLeaves[depth] += 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue