func genTestTx() (*wire.MsgTx, error) {
	tx := wire.NewMsgTx(2)
	tx.Version = rand.Int31()
	numTxins := rand.Intn(11)
	for i := 0; i < numTxins; i++ {
		randTxIn := wire.TxIn{
			PreviousOutPoint: wire.OutPoint{
				Index: uint32(rand.Int31()),
			},
			Sequence: uint32(rand.Int31()),
		}
		_, err := rand.Read(randTxIn.PreviousOutPoint.Hash[:])
		if err != nil {
			return nil, err
		}
		tx.TxIn = append(tx.TxIn, &randTxIn)
	}
	numTxouts := rand.Intn(11)
	for i := 0; i < numTxouts; i++ {
		randTxOut := wire.TxOut{
			Value:    rand.Int63(),
			PkScript: make([]byte, rand.Intn(30)),
		}
		if _, err := rand.Read(randTxOut.PkScript); err != nil {
			return nil, err
		}
		tx.TxOut = append(tx.TxOut, &randTxOut)
	}
	return tx, nil
}
genTestTx creates a random transaction for uses within test cases.
package txscript
import (
	"math/rand"
	"testing"
	"time"
	"github.com/btcsuite/btcd/wire"
	"github.com/davecgh/go-spew/spew"
)