Documentation ¶
Index ¶
- func AdvancedComplexNonLinear(x float64) float64
- func BasicComplexNonLinear(x float64) float64
- func BlockLevel(header externalapi.BlockHeader, maxBlockLevel int) int
- func CheckProofOfWorkByBits(header externalapi.MutableBlockHeader) bool
- func ComplexNonLinear(x float64) float64
- func ExaComplexNonLinear(x float64) float64
- func ExtremlyComplexNonLinear(x float64) float64
- func GenerateHoohashMatrix(hash *externalapi.DomainHash) *matrix
- func GigaComplexNonLinear(x float64) float64
- func HighComplexNonLinear(x float64) float64
- func HyperComplexNonLinear(x float64) float64
- func IntermediateComplexNonLinear(x float64) float64
- func MediumComplexNonLinear(x float64) float64
- func MegaComplexNonLinear(x float64) float64
- func PetaComplexNonLinear(x float64) float64
- func SuperComplexNonLinear(x float64) float64
- func TeraComplexNonLinear(x float64) float64
- func UltraComplexNonLinear(x float64) float64
- func VeryComplexNonLinear(x float64) float64
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdvancedComplexNonLinear ¶ added in v1.2.0
func BasicComplexNonLinear ¶ added in v1.2.0
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 ¶ added in v1.2.0
func ExaComplexNonLinear ¶ added in v1.2.0
func ExtremlyComplexNonLinear ¶ added in v1.2.0
func GenerateHoohashMatrix ¶ added in v1.2.0
func GenerateHoohashMatrix(hash *externalapi.DomainHash) *matrix
func GigaComplexNonLinear ¶ added in v1.2.0
func HighComplexNonLinear ¶ added in v1.2.0
func HyperComplexNonLinear ¶ added in v1.2.0
func IntermediateComplexNonLinear ¶ added in v1.2.0
func MediumComplexNonLinear ¶ added in v1.2.0
func MegaComplexNonLinear ¶ added in v1.2.0
func PetaComplexNonLinear ¶ added in v1.2.0
func SuperComplexNonLinear ¶ added in v1.2.0
func TeraComplexNonLinear ¶ added in v1.2.0
func UltraComplexNonLinear ¶ added in v1.2.0
func VeryComplexNonLinear ¶ added in v1.2.0
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) CalculateProofOfWorkValueHooHash ¶ added in v1.2.0
CalculateProofOfWorkValue hashes the internal header and returns its big.Int value
func (*State) CalculateProofOfWorkValueKarlsenHash ¶ added in v1.2.0
CalculateProofOfWorkValue hashes the internal header and returns its big.Int value
func (*State) CheckProofOfWork ¶
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