mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
trie: remove panics
This commit is contained in:
parent
405b06a6a6
commit
4325419711
2 changed files with 1 additions and 8 deletions
|
|
@ -88,11 +88,7 @@ func (c *committer) Commit(n node, db *Database) (hashNode, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
hn, ok := h.(hashNode)
|
return h.(hashNode), nil
|
||||||
if !ok {
|
|
||||||
panic("commit did not hash down to a hashnode!")
|
|
||||||
}
|
|
||||||
return hn, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// commit collapses a node down into a hash node and inserts it into the database
|
// commit collapses a node down into a hash node and inserts it into the database
|
||||||
|
|
|
||||||
|
|
@ -451,9 +451,6 @@ func (t *Trie) Commit(onleaf LeafCallback) (root common.Hash, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return common.Hash{}, err
|
return common.Hash{}, err
|
||||||
}
|
}
|
||||||
if common.BytesToHash(newRoot) != rootHash {
|
|
||||||
panic(fmt.Sprintf("Committed root %x != roothash %x", newRoot, rootHash))
|
|
||||||
}
|
|
||||||
t.root = newRoot
|
t.root = newRoot
|
||||||
return rootHash, nil
|
return rootHash, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue