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 {
|
||||
return nil, err
|
||||
}
|
||||
hn, ok := h.(hashNode)
|
||||
if !ok {
|
||||
panic("commit did not hash down to a hashnode!")
|
||||
}
|
||||
return hn, nil
|
||||
return h.(hashNode), nil
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return common.Hash{}, err
|
||||
}
|
||||
if common.BytesToHash(newRoot) != rootHash {
|
||||
panic(fmt.Sprintf("Committed root %x != roothash %x", newRoot, rootHash))
|
||||
}
|
||||
t.root = newRoot
|
||||
return rootHash, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue