pow

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: GPL-3.0 Imports: 9 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 + prev_hash); data + nonce < target.

func Init

func Init(vMTestParamEnabled bool)

func MapPowNonce

func MapPowNonce(difficulty *big.Int, dataHash types.Hash, from uint64, to uint64) ([]byte, uint64, error)

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

func MapPowNonce2

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

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

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