func Create(ns walletdb.ReadWriteBucket) error {
	return createStore(ns)
}
Create creates a new persistent transaction store in the walletdb namespace.
Creating the store when one already exists in this namespace will error with
ErrAlreadyExists.
package wtxmgr
import (
	"bytes"
	"time"
	"github.com/gcash/bchd/blockchain"
	"github.com/gcash/bchd/chaincfg"
	"github.com/gcash/bchd/chaincfg/chainhash"
	"github.com/gcash/bchd/wire"
	"github.com/gcash/bchutil"
	"github.com/gcash/bchwallet/walletdb"
)
type Block struct {
	Hash   chainhash.Hash
	Height int32
}
type BlockMeta struct {
	Block
	Time time.Time
}
type blockRecord struct {
	Block
	Time         time.Time
	transactions []chainhash.Hash
}
type incidence struct {
	txHash chainhash.Hash
	block  Block
}
type indexedIncidence struct {
	incidence
	index uint32
}
type debit struct {
	txHash chainhash.Hash
	index  uint32
	amount bchutil.Amount
	spends indexedIncidence
}
type credit struct {
	outPoint wire.OutPoint
	block    Block
	amount   bchutil.Amount
	change   bool
	spentBy  indexedIncidence  
}
type TxRecord struct {
	MsgTx        wire.MsgTx
	Hash         chainhash.Hash
	Received     time.Time
	SerializedTx []byte  
}
func NewTxRecord(serializedTx []byte, received time.Time) (*TxRecord, error) {
	rec := &TxRecord{
		Received:     received,
		SerializedTx: serializedTx,
	}
	err := rec.MsgTx.Deserialize(bytes.NewReader(serializedTx))
	if err != nil {
		str := "failed to deserialize transaction"
		return nil, storeError(ErrInput, str, err)
	}
	copy(rec.Hash[:], chainhash.DoubleHashB(serializedTx))
	return rec, nil
}
func NewTxRecordFromMsgTx(msgTx *wire.MsgTx, received time.Time) (*TxRecord, error) {
	buf := bytes.NewBuffer(make([]byte, 0, msgTx.SerializeSize()))
	err := msgTx.Serialize(buf)
	if err != nil {
		str := "failed to serialize transaction"
		return nil, storeError(ErrInput, str, err)
	}
	rec := &TxRecord{
		MsgTx:        *msgTx,
		Received:     received,
		SerializedTx: buf.Bytes(),
		Hash:         msgTx.TxHash(),
	}
	return rec, nil
}
type Credit struct {
	wire.OutPoint
	BlockMeta
	Amount       bchutil.Amount
	PkScript     []byte
	Received     time.Time
	FromCoinBase bool
}
type Store struct {
	chainParams *chaincfg.Params
	NotifyUnspent func(hash *chainhash.Hash, index uint32)
}
func Open(ns walletdb.ReadBucket, chainParams *chaincfg.Params) (*Store, error) {
	err := openStore(ns)
	if err != nil {
		return nil, err
	}
	s := &Store{chainParams, nil}  
	return s, nil
}