pow

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: ISC Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvancedComplexNonLinear

func AdvancedComplexNonLinear(x float64) float64

func BasicComplexNonLinear

func BasicComplexNonLinear(x float64) float64

func BlockLevel

func BlockLevel(header externalapi.BlockHeader, maxBlockLevel int) int

BlockLevel returns the block level of the given header.

func CheckProofOfWorkByBits

func CheckProofOfWorkByBits(header externalapi.MutableBlockHeader) bool

CheckProofOfWorkByBits check's if the block has a valid PoW according to its Bits field it does not check if the difficulty itself is valid or less than the maximum for the appropriate network

func ComplexNonLinear

func ComplexNonLinear(x float64) float64

func ExaComplexNonLinear

func ExaComplexNonLinear(x float64) float64

func ExtremlyComplexNonLinear

func ExtremlyComplexNonLinear(x float64) float64

func GenerateHoohashMatrix added in v1.0.2

func GenerateHoohashMatrix(hash *externalapi.DomainHash) *matrix

func GenerateMatrix added in v1.0.2

func GenerateMatrix(hash *externalapi.DomainHash) *matrix

func GigaComplexNonLinear

func GigaComplexNonLinear(x float64) float64

func HighComplexNonLinear

func HighComplexNonLinear(x float64) float64

func HyperComplexNonLinear

func HyperComplexNonLinear(x float64) float64

func IntermediateComplexNonLinear

func IntermediateComplexNonLinear(x float64) float64

func MediumComplexNonLinear

func MediumComplexNonLinear(x float64) float64

func MegaComplexNonLinear

func MegaComplexNonLinear(x float64) float64

func PetaComplexNonLinear

func PetaComplexNonLinear(x float64) float64

func SuperComplexNonLinear

func SuperComplexNonLinear(x float64) float64

func TeraComplexNonLinear

func TeraComplexNonLinear(x float64) float64

func UltraComplexNonLinear

func UltraComplexNonLinear(x float64) float64

func VeryComplexNonLinear

func VeryComplexNonLinear(x float64) float64

Types

type State

type State struct {
	Timestamp int64
	Nonce     uint64
	Target    big.Int
	// contains filtered or unexported fields
}

State is an intermediate data structure with pre-computed values to speed up mining.

func NewState

func NewState(header externalapi.MutableBlockHeader) *State

NewState creates a new state with pre-computed values to speed up mining It takes the target from the Bits field

func (*State) CalculateProofOfWorkValue

func (state *State) CalculateProofOfWorkValue() *big.Int

func (*State) CalculateProofOfWorkValueHoohashV1

func (state *State) CalculateProofOfWorkValueHoohashV1() *big.Int

func (*State) CalculateProofOfWorkValueHoohashV2

func (state *State) CalculateProofOfWorkValueHoohashV2() *big.Int

func (*State) CalculateProofOfWorkValuePyrinhash

func (state *State) CalculateProofOfWorkValuePyrinhash() *big.Int

CalculateProofOfWorkValue hashes the internal header and returns its big.Int value

func (*State) CheckProofOfWork

func (state *State) CheckProofOfWork() bool

CheckProofOfWork check's if the block has a valid PoW according to the provided target it does not check if the difficulty itself is valid or less than the maximum for the appropriate network

func (*State) IncrementNonce

func (state *State) IncrementNonce()

IncrementNonce the nonce in State by 1

Jump to

Keyboard shortcuts

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