func (t *TreeTransaction) Set(key chainhash.Hash, value chainhash.Hash) error {
	// if the t is empty, insert at the root

	hk := chainhash.HashH(key[:])

	root, err := t.tx.Root()
	if err != nil {
		return err
	}

	n, err := insertIntoTree(t.tx, root, hk, value, 255)
	if err != nil {
		return err
	}

	err = t.tx.SetRoot(n)
	if err != nil {
		return err
	}

	return t.tx.Set(key, value)
}
// Set inserts/updates a value
Set inserts/updates a value
// Set inserts / updates a value
func (t *TreeTransaction) Set(key chainhash.Hash, value chainhash.Hash) error {
	hk := chainhash.HashH(key[:])
	root, err := t.tx.Root()
	if err != nil {
		return err
	}
	n, err := insertIntoTree(t.tx, root, hk, value, 255)
	if err != nil {
		return err
	}
	err = t.tx.SetRoot(n)
	if err != nil {
		return err
	}
	return t.tx.Set(key, value)
}
func ( t * TreeTransaction ) Set ( key chainhash . Hash , value chainhash . Hash ) error { hk := chainhash . HashH ( key [ : ] ) root , err := t . tx . Root ( ) if err != nil { return err } n , err := insertIntoTree ( t . tx , root , hk , value , 255 ) if err != nil { return err } err = t . tx . SetRoot ( n ) if err != nil { return err } return t . tx . Set ( key , value ) }
Set inserts/updates a value
Set inserts / updates a value
// if the t is empty, insert at the root