Versions in this module Expand all Collapse all v1 v1.4.2 Sep 9, 2019 v1.4.1 Aug 12, 2019 Changes in this version + const DBVersion + const DefaultAccountNum + const ExternalBranch + const ImportedAddrAccount + const ImportedAddrAccountName + const InternalBranch + const MaxAccountNum + const MaxAddressesPerAccount + const TSImmatureOrLive + const TSMissed + const TSVoted + func AgendaPreference(tx walletdb.ReadTx, version uint32, agendaID string) (choiceID string) + func CoinTypes(params *chaincfg.Params) (legacyCoinType, slip0044CoinType uint32) + func DisableLog() + func ExtractBlockHeaderHeight(header []byte) int32 + func ExtractBlockHeaderParentHash(header []byte) []byte + func ExtractBlockHeaderTime(header []byte) int64 + func Initialize(db walletdb.DB, params *chaincfg.Params, seed, pubPass, privPass []byte) error + func InitializeWatchOnly(db walletdb.DB, params *chaincfg.Params, hdPubKey string, pubPass []byte) error + func Migrate(db walletdb.DB, params *chaincfg.Params) error + func NeedsMigration(db walletdb.DB) (bool, error) + func Open(db walletdb.DB, params *chaincfg.Params, pubPass []byte) (addrMgr *Manager, txStore *Store, stakeStore *StakeStore, err error) + func SetAgendaPreference(tx walletdb.ReadWriteTx, version uint32, agendaID, choiceID string) error + func Upgrade(db walletdb.DB, publicPassphrase []byte, params *chaincfg.Params) error + func UseLogger(logger slog.Logger) + func ValidateAccountName(name string) error + type AccountProperties struct + AccountName string + AccountNumber uint32 + ImportedKeyCount uint32 + LastReturnedExternalIndex uint32 + LastReturnedInternalIndex uint32 + LastUsedExternalIndex uint32 + LastUsedInternalIndex uint32 + type Balances struct + Account uint32 + ImmatureCoinbaseRewards dcrutil.Amount + ImmatureStakeGeneration dcrutil.Amount + LockedByTickets dcrutil.Amount + Spendable dcrutil.Amount + Total dcrutil.Amount + Unconfirmed dcrutil.Amount + VotingAuthority dcrutil.Amount + type Block struct + Hash chainhash.Hash + Height int32 + type BlockCFilter struct + BlockHash chainhash.Hash + Filter *gcs.Filter + type BlockHeaderData struct + BlockHash chainhash.Hash + SerializedHeader RawBlockHeader + type BlockMeta struct + Time time.Time + VoteBits uint16 + type Credit struct + Amount dcrutil.Amount + FromCoinBase bool + HasExpiry bool + PkScript []byte + Received time.Time + type CreditRecord struct + Amount dcrutil.Amount + Change bool + HasExpiry bool + Index uint32 + IsCoinbase bool + OpCode uint8 + Spent bool + type CryptoKeyType byte + const CKTPrivate + const CKTPublic + const CKTScript + type DebitRecord struct + Amount dcrutil.Amount + Index uint32 + type EncryptorDecryptor interface + Bytes func() []byte + CopyBytes func([]byte) + Decrypt func(in []byte) ([]byte, error) + Encrypt func(in []byte) ([]byte, error) + Zero func() + type InputSource struct + func (s *InputSource) SelectInputs(target dcrutil.Amount) (*txauthor.InputDetail, error) + type ManagedAddress interface + Account func() uint32 + AddrHash func() []byte + Address func() dcrutil.Address + Compressed func() bool + Imported func() bool + Internal func() bool + Multisig func() bool + type ManagedPubKeyAddress interface + ExportPubKey func() string + Index func() uint32 + PubKey func() chainec.PublicKey + type ManagedScriptAddress interface + type Manager struct + func (m *Manager) AccountBranchExtendedPubKey(dbtx walletdb.ReadTx, account, branch uint32) (*hdkeychain.ExtendedKey, error) + func (m *Manager) AccountExtendedPubKey(dbtx walletdb.ReadTx, account uint32) (*hdkeychain.ExtendedKey, error) + func (m *Manager) AccountName(ns walletdb.ReadBucket, account uint32) (string, error) + func (m *Manager) AccountProperties(ns walletdb.ReadBucket, account uint32) (*AccountProperties, error) + func (m *Manager) AddrAccount(ns walletdb.ReadBucket, address dcrutil.Address) (uint32, error) + func (m *Manager) Address(ns walletdb.ReadBucket, address dcrutil.Address) (ManagedAddress, error) + func (m *Manager) ChainParams() *chaincfg.Params + func (m *Manager) ChangePassphrase(ns walletdb.ReadWriteBucket, oldPassphrase, newPassphrase []byte, private bool) error + func (m *Manager) Close() error + func (m *Manager) CoinType(dbtx walletdb.ReadTx) (uint32, error) + func (m *Manager) CoinTypePrivKey(dbtx walletdb.ReadTx) (*hdkeychain.ExtendedKey, error) + func (m *Manager) ConvertToWatchingOnly(ns walletdb.ReadWriteBucket) error + func (m *Manager) Decrypt(keyType CryptoKeyType, in []byte) ([]byte, error) + func (m *Manager) Encrypt(keyType CryptoKeyType, in []byte) ([]byte, error) + func (m *Manager) ExistsHash160(ns walletdb.ReadBucket, hash160 []byte) bool + func (m *Manager) ForEachAccount(ns walletdb.ReadBucket, fn func(account uint32) error) error + func (m *Manager) ForEachAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (m *Manager) ForEachActiveAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (m *Manager) ForEachActiveAddress(ns walletdb.ReadBucket, fn func(addr dcrutil.Address) error) error + func (m *Manager) GetMasterPubkey(ns walletdb.ReadBucket, account uint32) (string, error) + func (m *Manager) ImportPrivateKey(ns walletdb.ReadWriteBucket, wif *dcrutil.WIF) (ManagedPubKeyAddress, error) + func (m *Manager) ImportScript(ns walletdb.ReadWriteBucket, script []byte) (ManagedScriptAddress, error) + func (m *Manager) IsLocked() bool + func (m *Manager) LastAccount(ns walletdb.ReadBucket) (uint32, error) + func (m *Manager) Lock() error + func (m *Manager) LookupAccount(ns walletdb.ReadBucket, name string) (uint32, error) + func (m *Manager) MarkReturnedChildIndex(tx walletdb.ReadWriteTx, account, branch, child uint32) error + func (m *Manager) MarkUsed(ns walletdb.ReadWriteBucket, address dcrutil.Address) error + func (m *Manager) MarkUsedChildIndex(tx walletdb.ReadWriteTx, account, branch, child uint32) error + func (m *Manager) NewAccount(ns walletdb.ReadWriteBucket, name string) (uint32, error) + func (m *Manager) PrivateKey(ns walletdb.ReadBucket, addr dcrutil.Address) (key chainec.PrivateKey, done func(), err error) + func (m *Manager) RedeemScript(ns walletdb.ReadBucket, addr dcrutil.Address) (script []byte, done func(), err error) + func (m *Manager) RenameAccount(ns walletdb.ReadWriteBucket, account uint32, name string) error + func (m *Manager) SyncAccountToAddrIndex(ns walletdb.ReadWriteBucket, account uint32, syncToIndex uint32, branch uint32) error + func (m *Manager) Unlock(ns walletdb.ReadBucket, passphrase []byte) error + func (m *Manager) UpgradeToSLIP0044CoinType(dbtx walletdb.ReadWriteTx) error + func (m *Manager) WatchingOnly() bool + type MultisigCredit struct + Amount dcrutil.Amount + M uint8 + MSScript []byte + N uint8 + OutPoint *wire.OutPoint + ScriptHash [ripemd160.Size]byte + type MultisigOut struct + Amount dcrutil.Amount + BlockHash chainhash.Hash + BlockHeight uint32 + M uint8 + N uint8 + OutPoint *wire.OutPoint + ScriptHash [ripemd160.Size]byte + Spent bool + SpentBy chainhash.Hash + SpentByIndex uint32 + Tree int8 + TxHash chainhash.Hash + type ObtainUserInputFunc func() ([]byte, error) + type PoolTicket struct + HeightSpent uint32 + HeightTicket uint32 + SpentBy chainhash.Hash + Status TicketStatus + Ticket chainhash.Hash + type RawBlockHeader [180]byte + func (h *RawBlockHeader) Height() int32 + type ScryptOptions struct + N int + P int + R int + type StakePoolUser struct + InvalidTickets []*chainhash.Hash + Tickets []*PoolTicket + type StakeStore struct + Manager *Manager + Params *chaincfg.Params + func (s *StakeStore) DumpSStxHashes() []chainhash.Hash + func (s *StakeStore) DumpSStxHashesForAddress(ns walletdb.ReadBucket, addr dcrutil.Address) ([]chainhash.Hash, error) + func (s *StakeStore) InsertSStx(ns walletdb.ReadWriteBucket, sstx *dcrutil.Tx) error + func (s *StakeStore) OwnTicket(hash *chainhash.Hash) bool + func (s *StakeStore) RemoveStakePoolUserInvalTickets(ns walletdb.ReadWriteBucket, user dcrutil.Address, ticket *chainhash.Hash) error + func (s *StakeStore) SStxAddress(ns walletdb.ReadBucket, hash *chainhash.Hash) (dcrutil.Address, error) + func (s *StakeStore) StakePoolUserInfo(ns walletdb.ReadBucket, user dcrutil.Address) (*StakePoolUser, error) + func (s *StakeStore) TicketPurchase(dbtx walletdb.ReadTx, hash *chainhash.Hash) (*wire.MsgTx, error) + func (s *StakeStore) UpdateStakePoolUserInvalTickets(ns walletdb.ReadWriteBucket, user dcrutil.Address, ticket *chainhash.Hash) error + func (s *StakeStore) UpdateStakePoolUserTickets(ns walletdb.ReadWriteBucket, user dcrutil.Address, ticket *PoolTicket) error + type Store struct + func (s *Store) AccountBalance(ns, addrmgrNs walletdb.ReadBucket, minConf int32, account uint32) (Balances, error) + func (s *Store) AccountBalances(ns, addrmgrNs walletdb.ReadBucket, minConf int32) (map[uint32]*Balances, error) + func (s *Store) AddCredit(ns walletdb.ReadWriteBucket, rec *TxRecord, block *BlockMeta, index uint32, ...) error + func (s *Store) AddMultisigOut(ns walletdb.ReadWriteBucket, rec *TxRecord, block *BlockMeta, index uint32) error + func (s *Store) BlockInMainChain(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) (inMainChain bool, invalidated bool) + func (s *Store) CFilter(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) (*gcs.Filter, error) + func (s *Store) ExistsTx(ns walletdb.ReadBucket, txHash *chainhash.Hash) bool + func (s *Store) ExistsUTXO(dbtx walletdb.ReadTx, op *wire.OutPoint) bool + func (s *Store) ExtendMainChain(ns walletdb.ReadWriteBucket, header *wire.BlockHeader, f *gcs.Filter) error + func (s *Store) GetBlockHeader(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) (*wire.BlockHeader, error) + func (s *Store) GetBlockMetaForHash(ns walletdb.ReadBucket, blockHash *chainhash.Hash) (BlockMeta, error) + func (s *Store) GetMainChainBlockHashForHeight(ns walletdb.ReadBucket, height int32) (chainhash.Hash, error) + func (s *Store) GetMainChainBlockHashes(ns walletdb.ReadBucket, startHash *chainhash.Hash, inclusive bool, ...) ([]chainhash.Hash, error) + func (s *Store) GetMainChainCFilters(dbtx walletdb.ReadTx, startHash *chainhash.Hash, inclusive bool, ...) ([]*BlockCFilter, error) + func (s *Store) GetMultisigOutput(ns walletdb.ReadBucket, op *wire.OutPoint) (*MultisigOut, error) + func (s *Store) GetSerializedBlockHeader(ns walletdb.ReadBucket, blockHash *chainhash.Hash) ([]byte, error) + func (s *Store) GetTxScript(ns walletdb.ReadBucket, hash []byte) ([]byte, error) + func (s *Store) InsertMemPoolTx(ns walletdb.ReadWriteBucket, rec *TxRecord) error + func (s *Store) InsertMinedTx(ns walletdb.ReadWriteBucket, addrmgrNs walletdb.ReadBucket, rec *TxRecord, ...) error + func (s *Store) InsertMissingCFilters(dbtx walletdb.ReadWriteTx, blockHashes []*chainhash.Hash, ...) error + func (s *Store) InsertTxScript(ns walletdb.ReadWriteBucket, script []byte) error + func (s *Store) IsMissingMainChainCFilters(dbtx walletdb.ReadTx) bool + func (s *Store) IsUnspentOutpoint(dbtx walletdb.ReadTx, op *wire.OutPoint) bool + func (s *Store) IterateTickets(dbtx walletdb.ReadTx) *TicketIterator + func (s *Store) MainChainTip(ns walletdb.ReadBucket) (chainhash.Hash, int32) + func (s *Store) MakeInputSource(ns, addrmgrNs walletdb.ReadBucket, account uint32, minConf, syncHeight int32) InputSource + func (s *Store) MissingCFiltersHeight(dbtx walletdb.ReadTx) (int32, error) + func (s *Store) OwnTicket(dbtx walletdb.ReadTx, ticketHash *chainhash.Hash) bool + func (s *Store) PreviousPkScripts(ns walletdb.ReadBucket, rec *TxRecord, block *Block) ([][]byte, error) + func (s *Store) ProcessedTxsBlockMarker(dbtx walletdb.ReadTx) *chainhash.Hash + func (s *Store) PruneUnmined(dbtx walletdb.ReadWriteTx, stakeDiff int64) error + func (s *Store) RangeTransactions(ns walletdb.ReadBucket, begin, end int32, f func([]TxDetails) (bool, error)) error + func (s *Store) RemoveUnconfirmed(ns walletdb.ReadWriteBucket, tx *wire.MsgTx, txHash *chainhash.Hash) error + func (s *Store) Rollback(ns walletdb.ReadWriteBucket, addrmgrNs walletdb.ReadBucket, height int32) error + func (s *Store) SpendMultisigOut(ns walletdb.ReadWriteBucket, op *wire.OutPoint, spendHash chainhash.Hash, ...) error + func (s *Store) StoredTxScripts(ns walletdb.ReadBucket) [][]byte + func (s *Store) TicketDetails(ns walletdb.ReadBucket, txDetails *TxDetails) (*TicketDetails, error) + func (s *Store) TotalInput(dbtx walletdb.ReadTx, tx *wire.MsgTx) (dcrutil.Amount, error) + func (s *Store) Tx(ns walletdb.ReadBucket, txHash *chainhash.Hash) (*wire.MsgTx, error) + func (s *Store) TxBlockHeight(dbtx walletdb.ReadTx, txHash *chainhash.Hash) (int32, error) + func (s *Store) TxDetails(ns walletdb.ReadBucket, txHash *chainhash.Hash) (*TxDetails, error) + func (s *Store) UniqueTxDetails(ns walletdb.ReadBucket, txHash *chainhash.Hash, block *Block) (*TxDetails, error) + func (s *Store) UnminedTxHashes(ns walletdb.ReadBucket) ([]*chainhash.Hash, error) + func (s *Store) UnminedTxs(ns walletdb.ReadBucket) ([]*wire.MsgTx, error) + func (s *Store) UnspentMultisigCreditsForAddress(ns walletdb.ReadBucket, addr dcrutil.Address) ([]*MultisigCredit, error) + func (s *Store) UnspentOutpoints(ns walletdb.ReadBucket) ([]wire.OutPoint, error) + func (s *Store) UnspentOutputs(ns walletdb.ReadBucket) ([]*Credit, error) + func (s *Store) UnspentOutputsForAmount(ns, addrmgrNs walletdb.ReadBucket, needed dcrutil.Amount, syncHeight int32, ...) ([]*Credit, error) + func (s *Store) UnspentTickets(dbtx walletdb.ReadTx, syncHeight int32, includeImmature bool) ([]chainhash.Hash, error) + func (s *Store) UpdateProcessedTxsBlockMarker(dbtx walletdb.ReadWriteTx, hash *chainhash.Hash) error + type Ticket struct + Block Block + SpenderHash chainhash.Hash + type TicketDetails struct + Spender *TxDetails + Ticket *TxDetails + type TicketIterator struct + func (it *TicketIterator) Close() + func (it *TicketIterator) Err() error + func (it *TicketIterator) Next() bool + type TicketStatus uint8 + type TxDetails struct + Block BlockMeta + Credits []CreditRecord + Debits []DebitRecord + func (t *TxDetails) Height() int32 + type TxRecord struct + Hash chainhash.Hash + MsgTx wire.MsgTx + Received time.Time + SerializedTx []byte + TxType stake.TxType + func NewTxRecord(serializedTx []byte, received time.Time) (*TxRecord, error) + func NewTxRecordFromMsgTx(msgTx *wire.MsgTx, received time.Time) (*TxRecord, error)