Elastos.ELA.SPV: github.com/elastos/Elastos.ELA.SPV/wallet/store/headers Index | Files

package headers

import "github.com/elastos/Elastos.ELA.SPV/wallet/store/headers"


Package Files

cache.go database.go log.go


var (
    BKTHeaders  = []byte("H")
    BKTChainTip = []byte("B")

func DisableLog Uses

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func UseLogger Uses

func UseLogger(logger elalog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using elalog.

type Database Uses

type Database struct {
    // contains filtered or unexported fields

Headers implements Headers using bolt DB

func NewDatabase Uses

func NewDatabase(dataDir string) (*Database, error)

func (*Database) Clear Uses

func (d *Database) Clear() error

func (*Database) Close Uses

func (d *Database) Close() error

Close db

func (*Database) Get Uses

func (d *Database) Get(hash *common.Uint256) (header *util.Header, err error)

func (*Database) GetBest Uses

func (d *Database) GetBest() (header *util.Header, err error)

func (*Database) GetPrevious Uses

func (d *Database) GetPrevious(header *util.Header) (*util.Header, error)

func (*Database) Put Uses

func (d *Database) Put(header *util.Header, newTip bool) error

Package headers imports 12 packages (graph) and is imported by 3 packages. Updated 2019-05-11. Refresh now. Tools for package owners.