mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
parent
bf893cb73b
commit
5759893f2b
1 changed files with 2 additions and 4 deletions
|
|
@ -109,9 +109,8 @@ func (c *committer) commit(n node, db *Database) (node, error) {
|
||||||
hashedNode := c.store(collapsed, db)
|
hashedNode := c.store(collapsed, db)
|
||||||
if hn, ok := hashedNode.(hashNode); ok {
|
if hn, ok := hashedNode.(hashNode); ok {
|
||||||
return hn, nil
|
return hn, nil
|
||||||
} else {
|
|
||||||
return collapsed, nil
|
|
||||||
}
|
}
|
||||||
|
return collapsed, nil
|
||||||
case *fullNode:
|
case *fullNode:
|
||||||
hashedKids, err := c.commitChildren(cn, db)
|
hashedKids, err := c.commitChildren(cn, db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -256,7 +255,7 @@ func estimateSize(n node) int {
|
||||||
if child := n.Children[i]; child != nil {
|
if child := n.Children[i]; child != nil {
|
||||||
s += estimateSize(child)
|
s += estimateSize(child)
|
||||||
} else {
|
} else {
|
||||||
s += 1
|
s++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
|
|
@ -266,6 +265,5 @@ func estimateSize(n node) int {
|
||||||
return 1 + len(n)
|
return 1 + len(n)
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("Node type %T", n))
|
panic(fmt.Sprintf("Node type %T", n))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue