pow

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 5

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")
	// ErrParentsNotGiven is returned when no block parents and no refreshTipsFunc were given.
	ErrParentsNotGiven = errors.New("no parents given")
)

Functions

func DoPoW

func DoPoW(ctx context.Context, block *iotago.Block, deSeriMode serializer.DeSerializationMode, protoParams *iotago.ProtocolParameters, 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