code: func (t *Trie) Commit(onleaf LeafCallback) (root common.Hash, err error) {
  	if t.db == nil {
  		panic("commit called on trie with nil database")
  	}
  	hash, cached, err := t.hashRoot(t.db, onleaf)
  	if err != nil {
  		return common.Hash{}, err
  	}
  	t.root = cached
  	return common.BytesToHash(hash.(hashNode)), nil
  }
docs: // Commit writes all nodes to the trie's memory database, tracking the internal
  // and external (for account tries) references.