powmgr

package
v0.0.0-...-dee8dd0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2017 License: ISC Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 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 Pow

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

Pow is the proof-of-work manager.

func New

func New(powFunc func(target pow.Target, hash []byte) pow.Nonce) *Pow

New creates a new PowManager.

func (*Pow) Run

func (q *Pow) Run(target pow.Target, obj []byte, donePowFunc func(u pow.Nonce))

Run adds an object message with a target value for PoW to the end of the pow queue. It returns the index value of the stored element. If the PowManager is running, then a signal is sent to start running hashes immediately.

Jump to

Keyboard shortcuts

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