consensus

package
v0.0.0-...-0e482a4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAXU256 = &big.Int{}

Functions

func CalculatePowHash

func CalculatePowHash(headBlob []byte, nonce uint32, extra []byte) ([]byte, error)

func GetNextTargetHelper

func GetNextTargetHelper(blocks []BlockDiffInfo, timePlan uint64) (uint256.Int, error)

func SetHeaderNonce

func SetHeaderNonce(header []byte, nonce uint32, extra []byte) ([]byte, error)

func TargetToDiff

func TargetToDiff(target *uint256.Int) (*uint256.Int, error)

func VerifyHeaderDifficulty

func VerifyHeaderDifficulty(difficulty uint256.Int, headerDifficulty uint256.Int, headerBlob []byte, nonce uint32, extra []byte) (bool, error)

Types

type ArgonConsensus

type ArgonConsensus struct{}

func (ArgonConsensus) CalculatePowHash

func (ArgonConsensus) CalculatePowHash(headBlob []byte, nonce uint32, extra []byte) ([]byte, error)

func (ArgonConsensus) VerifyHeaderDifficulty

func (c ArgonConsensus) VerifyHeaderDifficulty(difficulty uint256.Int, headerDifficulty uint256.Int, headerBlob []byte, nonce uint32, extra []byte) (bool, error)

type BlockDiffInfo

type BlockDiffInfo struct {
	Timestamp uint64
	Target    uint256.Int
}

Jump to

Keyboard shortcuts

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