func (t *Tx) SetIndex(index int) {
	t.txIndex = index
}
SetIndex sets the index of the transaction in within a block.
package soterutil
import (
	"bytes"
	"io"
	"github.com/soteria-dag/soterd/chaincfg/chainhash"
	"github.com/soteria-dag/soterd/wire"
)
const TxIndexUnknown = -1
type Tx struct {
	msgTx         *wire.MsgTx      
	txHash        *chainhash.Hash  
	txHashWitness *chainhash.Hash  
	txHasWitness  *bool            
	txIndex       int              
}
func (t *Tx) MsgTx() *wire.MsgTx {
	return t.msgTx
}
func (t *Tx) Hash() *chainhash.Hash {
	if t.txHash != nil {
		return t.txHash
	}
	hash := t.msgTx.TxHash()
	t.txHash = &hash
	return &hash
}
func (t *Tx) WitnessHash() *chainhash.Hash {
	if t.txHashWitness != nil {
		return t.txHashWitness
	}
	hash := t.msgTx.WitnessHash()
	t.txHashWitness = &hash
	return &hash
}
func (t *Tx) HasWitness() bool {
	if t.txHashWitness != nil {
		return *t.txHasWitness
	}
	hasWitness := t.msgTx.HasWitness()
	t.txHasWitness = &hasWitness
	return hasWitness
}
func (t *Tx) Index() int {
	return t.txIndex
}