func (t *Tree) Update(cb func (access TreeTransactionAccess) error) error {
	return t.db.Update(func(tx TreeDatabaseTransaction) error {
		return cb(&TreeTransaction{tx, true})
	})
}
Update creates a transaction for the tree.
package csmt
import (
	"github.com/phoreproject/synapse/chainhash"
	"github.com/phoreproject/synapse/primitives"
)
type TreeDatabase interface {
	Update(func (TreeDatabaseTransaction) error) error
	View(func (TreeDatabaseTransaction) error) error
	Hash() (*chainhash.Hash, error)
}
type TreeDatabaseTransaction interface {
	Root() (*Node, error)
	Hash() (*chainhash.Hash, error)
	SetRoot(*Node) error
	NewNode(left *Node, right *Node, subtreeHash chainhash.Hash) (*Node, error)
	NewSingleNode(key chainhash.Hash, value chainhash.Hash, subtreeHash chainhash.Hash) (*Node, error)
	GetNode(chainhash.Hash) (*Node, error)
	SetNode(*Node) error
	DeleteNode(chainhash.Hash) error
	Get(chainhash.Hash) (*chainhash.Hash, error)
	Set(chainhash.Hash, chainhash.Hash) error
}
type Tree struct {
	db TreeDatabase
}
func NewTree(d TreeDatabase) Tree {
	return Tree{
		db: d,
	}
}