pow

package
v1.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOperationAborted is returned when the operation was aborted e.g. by a shutdown signal.
	ErrOperationAborted = errors.New("operation was aborted")
)

Functions

func DoPoW

func DoPoW(ctx context.Context, block *iotago.Block, targetScore float64, parallelism int, refreshTipsInterval time.Duration, refreshTipsFunc RefreshTipsFunc) (blockSize int, err error)

DoPoW does the proof-of-work required to hit the given target score. The given iota.Block's nonce is automatically updated.

Types

type RefreshTipsFunc

type RefreshTipsFunc = func() (tips iotago.BlockIDs, err error)

RefreshTipsFunc refreshes tips of the block if PoW takes longer than a configured duration.

Jump to

Keyboard shortcuts

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