Versions in this module Expand all Collapse all v0 v0.0.2 Feb 8, 2016 Changes in this version + const AddrIndexKeySize + const AllShas + var ErrAddrIndexDoesNotExist = errors.New(...) + var ErrBlockShaMissing = errors.New("requested block does not exist") + var ErrDbDoesNotExist = errors.New("non-existent database") + var ErrDbInconsistency = errors.New("inconsistent database") + var ErrDbUnknownType = errors.New("non-existent database type") + var ErrDuplicateSha = errors.New("duplicate insert attempted") + var ErrNotImplemented = errors.New("method has not yet been implemented") + var ErrPrevShaMissing = errors.New("previous sha missing from database") + var ErrTxShaMissing = errors.New("requested transaction does not exist") + var ErrUnsupportedAddressType = errors.New(...) + func AddDBDriver(instance DriverDB) + func DisableLog() + func GetLog() btclog.Logger + func SetLogWriter(w io.Writer, level string) error + func SupportedDBs() []string + func UseLogger(logger btclog.Logger) + type BlockAddrIndex []*TxAddrIndex + type Db interface + Close func() (err error) + DropAddrIndexForBlock func(blkSha *chainhash.Hash, height int64, addrIndex BlockAddrIndex) error + DropAfterBlockBySha func(*chainhash.Hash) (err error) + ExistsSha func(sha *chainhash.Hash) (exists bool, err error) + ExistsTxSha func(sha *chainhash.Hash) (exists bool, err error) + FetchAddrIndexTip func() (sha *chainhash.Hash, height int64, err error) + FetchBlockBySha func(sha *chainhash.Hash) (blk *dcrutil.Block, err error) + FetchBlockHeaderBySha func(sha *chainhash.Hash) (bh *wire.BlockHeader, err error) + FetchBlockHeightBySha func(sha *chainhash.Hash) (height int64, err error) + FetchBlockShaByHeight func(height int64) (sha *chainhash.Hash, err error) + FetchHeightRange func(startHeight, endHeight int64) (rshalist []chainhash.Hash, err error) + FetchTxBySha func(txsha *chainhash.Hash) ([]*TxListReply, error) + FetchTxByShaList func(txShaList []*chainhash.Hash) []*TxListReply + FetchTxsForAddr func(addr dcrutil.Address, skip int, limit int) ([]*TxListReply, error) + FetchUnSpentTxByShaList func(txShaList []*chainhash.Hash) []*TxListReply + InsertBlock func(block *dcrutil.Block) (height int64, err error) + NewestSha func() (sha *chainhash.Hash, height int64, err error) + PurgeAddrIndex func() error + RollbackClose func() (err error) + Sync func() (err error) + UpdateAddrIndexForBlock func(blkSha *chainhash.Hash, height int64, addrIndex BlockAddrIndex) error + func CreateDB(dbtype string, args ...interface{}) (pbdb Db, err error) + func OpenDB(dbtype string, args ...interface{}) (pbdb Db, err error) + type DriverDB struct + CreateDB func(args ...interface{}) (pbdb Db, err error) + DbType string + OpenDB func(args ...interface{}) (pbdb Db, err error) + type TxAddrIndex struct + Hash160 [ripemd160.Size]byte + Height uint32 + TxLen uint32 + TxOffset uint32 + type TxListReply struct + BlkSha *chainhash.Hash + Err error + Height int64 + Index uint32 + Sha *chainhash.Hash + Tx *wire.MsgTx + TxSpent []bool