Versions in this module Expand all Collapse all v0 v0.8.2 Feb 15, 2017 Changes in this version + const ErrChainStateShortRead + const ErrDatabaseInfoShortRead + const ErrLoadAllTickets + const ErrMissingKey + const ErrTicketHashesCorrupt + const ErrTicketHashesShortRead + const ErrUndoDataCorrupt + const ErrUndoDataShortRead + const ErrUninitializedBucket + func DbCreate(dbTx database.Tx) error + func DbDeleteTicket(dbTx database.Tx, ticketBucket []byte, hash *chainhash.Hash) error + func DbDropBlockUndoData(dbTx database.Tx, height uint32) error + func DbDropNewTickets(dbTx database.Tx, height uint32) error + func DbLoadAllTickets(dbTx database.Tx, ticketBucket []byte) (*tickettreap.Immutable, error) + func DbPutBestState(dbTx database.Tx, bcs BestChainState) error + func DbPutBlockUndoData(dbTx database.Tx, height uint32, utds []UndoTicketData) error + func DbPutDatabaseInfo(dbTx database.Tx, dbi *DatabaseInfo) error + func DbPutNewTickets(dbTx database.Tx, height uint32, ths TicketHashes) error + func DbPutTicket(dbTx database.Tx, ticketBucket []byte, hash *chainhash.Hash, height uint32, ...) error + type BestChainState struct + Hash chainhash.Hash + Height uint32 + Live uint32 + Missed uint64 + NextWinners []chainhash.Hash + PerBlock uint16 + Revoked uint64 + func DbFetchBestState(dbTx database.Tx) (BestChainState, error) + type DBError struct + Description string + ErrorCode ErrorCode + func (e DBError) Error() string + func (e DBError) GetCode() ErrorCode + type DatabaseInfo struct + Date time.Time + UpgradeStarted bool + Version uint32 + func DbFetchDatabaseInfo(dbTx database.Tx) (*DatabaseInfo, error) + type ErrorCode int + func (e ErrorCode) String() string + type TicketHashes []chainhash.Hash + func DbFetchNewTickets(dbTx database.Tx, height uint32) (TicketHashes, error) + type UndoTicketData struct + Expired bool + Missed bool + Revoked bool + Spent bool + TicketHash chainhash.Hash + TicketHeight uint32 + func DbFetchBlockUndoData(dbTx database.Tx, height uint32) ([]UndoTicketData, error)