func (t *InMemoryTreeDB) Hash() (*chainhash.Hash, error) {
	t.updateLock.RLock()
	defer t.updateLock.RUnlock()
	return &t.root, nil
}
Hash gets the root hash of the tree.
package csmt
import (
	"bytes"
	"errors"
	"fmt"
	"github.com/phoreproject/synapse/chainhash"
	"github.com/phoreproject/synapse/primitives"
	"io"
	"sync"
)
type InMemoryTreeDB struct {
	root  chainhash.Hash
	nodes map[chainhash.Hash]Node
	store map[chainhash.Hash]chainhash.Hash
	updateLock *sync.RWMutex
}