func (t *TreeMemoryCacheTransaction) NewNode(left *Node, right *Node, subtreeHash chainhash.Hash) (*Node, error) {
	if !t.update {
		return nil, errors.New("new node called on View transaction")
	}

	var leftHash *chainhash.Hash
	var rightHash *chainhash.Hash

	if left != nil {
		lh := left.GetHash()
		leftHash = &lh
	}

	if right != nil {
		rh := right.GetHash()
		rightHash = &rh
	}

	newNode := &Node{
		value: subtreeHash,
		left:  leftHash,
		right: rightHash,
	}
	t.dirty[subtreeHash] = *newNode
	return newNode, nil
}
// NewNode creates a new node and adds it to the cache.
NewNode creates a new node and adds it to the cache.
// NewNode creates a new node and adds it to the cache .
func (t *TreeMemoryCacheTransaction) NewNode(left *Node, right *Node, subtreeHash chainhash.Hash) (*Node, error) {
	if !t.update {
		return nil, errors.New("new node called on View transaction")
	}
	var leftHash *chainhash.Hash
	var rightHash *chainhash.Hash
	if left != nil {
		lh := left.GetHash()
		leftHash = &lh
	}
	if right != nil {
		rh := right.GetHash()
		rightHash = &rh
	}
	newNode := &Node{
		value: subtreeHash,
		left:  leftHash,
		right: rightHash,
	}
	t.dirty[subtreeHash] = *newNode
	return newNode, nil
}
func ( t * TreeMemoryCacheTransaction ) NewNode ( left * Node , right * Node , subtreeHash chainhash . Hash ) ( * Node , error ) { if ! t . update { return nil , errors . New ( " " ) } var leftHash * chainhash . Hash var rightHash * chainhash . Hash if left != nil { lh := left . GetHash ( ) leftHash = & lh } if right != nil { rh := right . GetHash ( ) rightHash = & rh } newNode := & Node { value : subtreeHash , left : leftHash , right : rightHash , } t . dirty [ subtreeHash ] = * newNode return newNode , nil }
NewNode creates a new node and adds it to the cache.
NewNode creates a new node and adds it to the cache .