pow

package
v0.0.0-...-96daba7 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// todo this is online difficulty !!!
	// FullThreshold = 0xffffffc000000000
	FullThreshold = 0x000000000000FFFF
)

Variables

View Source
var VMTestParamEnabled = false

Functions

func CheckPowNonce

func CheckPowNonce(difficulty *big.Int, nonce []byte, data []byte) bool

func DifficultyToTarget

func DifficultyToTarget(difficulty *big.Int) *big.Int

func GetPowNonce

func GetPowNonce(difficulty *big.Int, dataHash types.Hash) ([]byte, error)

data = Hash(address + prehash); data + nonce < target.

func Init

func Init(vMTestParamEnabled bool)

func QuickGreater

func QuickGreater(x, y []byte) bool

func QuickInc

func QuickInc(x []byte) []byte

func TargetToDifficulty

func TargetToDifficulty(target *big.Int) *big.Int

func Uint64ToByteArray

func Uint64ToByteArray(i uint64) [8]byte

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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