func (b *BadgerTreeTransaction) NewNode(left *Node, right *Node, subtreeHash chainhash.Hash) (*Node, error) {
	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,
	}

	return newNode, b.SetNode(newNode)
}
// NewNode creates a new node with the given left and right children and adds it to the database.
NewNode creates a new node with the given left and right children and adds it to the database.
// NewNode creates a new node with the given left and right children and adds it to the database .
func (b *BadgerTreeTransaction) NewNode(left *Node, right *Node, subtreeHash chainhash.Hash) (*Node, error) {
	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,
	}
	return newNode, b.SetNode(newNode)
}
func ( b * BadgerTreeTransaction ) NewNode ( left * Node , right * Node , subtreeHash chainhash . Hash ) ( * Node , error ) { 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 , } return newNode , b . SetNode ( newNode ) }
NewNode creates a new node with the given left and right children and adds it to the database.
NewNode creates a new node with the given left and right children and adds it to the database .