Versions in this module Expand all Collapse all v6 v6.0.0 Sep 3, 2021 Changes in this version + const DefaultStakeDbName + const DefaultTicketPoolDbFolder + func DisableLog() + func UseLogger(logger slog.Logger) + type ChainMonitor struct + func (p *ChainMonitor) BlockConnectedHandler() + func (p *ChainMonitor) ConnectBlock(header *wire.BlockHeader) (err error) + func (p *ChainMonitor) ReorgHandler(reorg *txhelpers.ReorgData) error + func (p *ChainMonitor) SetNewBlockChan(blockChan chan *chainhash.Hash) + type NodeClient interface + GetBlock func(ctx context.Context, blockHash *chainhash.Hash) (*wire.MsgBlock, error) + GetBlockHash func(ctx context.Context, blockHeight int64) (*chainhash.Hash, error) + GetBlockHeader func(ctx context.Context, hash *chainhash.Hash) (*wire.BlockHeader, error) + type PoolDiff struct + In []chainhash.Hash + Out []chainhash.Hash + func LoadAllPoolDiffs(db *badger.DB, ver uint32) ([]PoolDiff, []uint64, error) + type PoolInfoCache struct + func NewPoolInfoCache(size int) (*PoolInfoCache, error) + func (c *PoolInfoCache) Get(hash chainhash.Hash) (*apitypes.TicketPoolInfo, bool) + func (c *PoolInfoCache) Set(hash chainhash.Hash, p *apitypes.TicketPoolInfo) + func (c *PoolInfoCache) SetCapacity(size int) error + type StakeDatabase struct + BestNode *stake.Node + NodeClient NodeClient + PoolDB *TicketPool + StakeDB database.DB + func LoadAndRecover(client NodeClient, params *chaincfg.Params, dataDir string, toHeight int64) (*StakeDatabase, error) + func NewStakeDatabase(client NodeClient, params *chaincfg.Params, dataDir string) (*StakeDatabase, int64, error) + func (db *StakeDatabase) BlockCached(ind int64) (*dcrutil.Block, bool) + func (db *StakeDatabase) Close() error + func (db *StakeDatabase) ConnectBlock(block *dcrutil.Block) error + func (db *StakeDatabase) ConnectBlockHash(hash *chainhash.Hash) (*dcrutil.Block, error) + func (db *StakeDatabase) DBPrevBlock() (*dcrutil.Block, error) + func (db *StakeDatabase) DBPrevBlockHeader() (*wire.BlockHeader, error) + func (db *StakeDatabase) DBState() (uint32, *chainhash.Hash, error) + func (db *StakeDatabase) DBTipBlock() (*dcrutil.Block, error) + func (db *StakeDatabase) DBTipBlockHeader() (*wire.BlockHeader, error) + func (db *StakeDatabase) DisconnectBlock(neglectCache bool) error + func (db *StakeDatabase) DisconnectBlocks(count int64) error + func (db *StakeDatabase) EmptyCopy(dataDir string) (*StakeDatabase, int64, error) + func (db *StakeDatabase) ForgetBlock(ind int64) + func (db *StakeDatabase) Height() uint32 + func (db *StakeDatabase) LockStakeNode() + func (db *StakeDatabase) NewChainMonitor(ctx context.Context) *ChainMonitor + func (db *StakeDatabase) Open(dbName string) error + func (db *StakeDatabase) PoolAtHash(hash chainhash.Hash) ([]chainhash.Hash, error) + func (db *StakeDatabase) PoolAtHeight(height int64) ([]chainhash.Hash, error) + func (db *StakeDatabase) PoolInfo(hash chainhash.Hash) (*apitypes.TicketPoolInfo, bool) + func (db *StakeDatabase) PoolInfoBest() *apitypes.TicketPoolInfo + func (db *StakeDatabase) PoolSize() int + func (db *StakeDatabase) PopulateLiveTicketCache() error + func (db *StakeDatabase) Rewind(to int64, neglectCache bool) error + func (db *StakeDatabase) SetPoolCacheCapacity(cap int) error + func (db *StakeDatabase) SetPoolInfo(blockHash chainhash.Hash, tpi *apitypes.TicketPoolInfo) + func (db *StakeDatabase) UnlockStakeNode() + func (db *StakeDatabase) WaitForHeight(height int64) chan *chainhash.Hash + type TicketPool struct + func NewTicketPool(dataDir, dbSubDir string) (tp *TicketPool, err error) + func (tp *TicketPool) AdvanceToTip() (int64, error) + func (tp *TicketPool) Append(diff *PoolDiff, height int64) error + func (tp *TicketPool) AppendAndAdvancePool(diff *PoolDiff, height int64) error + func (tp *TicketPool) Close() error + func (tp *TicketPool) CurrentPool() ([]chainhash.Hash, int64) + func (tp *TicketPool) CurrentPoolSize() int + func (tp *TicketPool) Cursor() int64 + func (tp *TicketPool) Pool(height int64) ([]chainhash.Hash, error) + func (tp *TicketPool) Tip() int64 + func (tp *TicketPool) Trim() (int64, PoolDiff) Other modules containing this package github.com/decred/dcrdata github.com/decred/dcrdata/stakedb github.com/decred/dcrdata/stakedb/v3 github.com/decred/dcrdata/v3 github.com/decred/dcrdata/v4 github.com/decred/dcrdata/v7