utxo

package
v0.0.0-...-1f4b7d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeySize = fmt.Errorf("wrong key length")

Functions

func DisableLog

func DisableLog()

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

func NewDB

func NewDB(path string) (*db, error)

func UseLogger

func UseLogger(logger btclog.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 btclog.

Types

type Balance

type Balance struct {
	Key   []byte
	Value int64
}

type BalanceCalc

type BalanceCalc struct {
	// contains filtered or unexported fields
}

func (*BalanceCalc) Calc

func (bc *BalanceCalc) Calc() error

type Config

type Config struct {
	EnableBalanceCalc    bool
	BalanceCalcPeriod    int32
	BalanceCalcThreshold int32
}

type DB

type DB interface {
	GetHeight() (int32, error)
	SetHeight(int32) error
	Get([]byte) (*Entry, error)
	PutBatch([]Entry) error
	GetBalance([]byte) (*Balance, error)
	PutBalance(*Balance) error
	GetIterator(prefix []byte) iterator.Iterator
	Close() error
}

type Entry

type Entry struct {
	Address []byte
	TxHash  *chainhash.Hash
	Value   int64
}

type Explorer

type Explorer struct {
	// contains filtered or unexported fields
}

func NewExplorer

func NewExplorer(
	chain *blockchain.BlockChain,
	chainParams *chaincfg.Params,
	db DB,
	config *Config) *Explorer

func (*Explorer) GetType

func (e *Explorer) GetType() string

func (*Explorer) Start

func (e *Explorer) Start()

func (*Explorer) Stop

func (e *Explorer) Stop()

func (*Explorer) WaitForShutdown

func (e *Explorer) WaitForShutdown()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL