difficulty

package
v0.0.0-...-d596c11 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Target block time of 20 minutes (middle of 10-30 range)
	TargetBlockTime = 1200 // seconds

	// Adjustment interval of 12 blocks (~4 hours with 20min blocks)
	AdjustmentInterval = 12

	// Limit difficulty change to 25% per adjustment
	MaxAdjustment = 1.25
	MinAdjustment = 0.75
)
View Source
const (
	// Maximum target (minimum difficulty)
	MaxTarget = "0x00000fffff000000000000000000000000000000000000000000000000000000"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adjuster

type Adjuster struct {
	// contains filtered or unexported fields
}

func NewAdjuster

func NewAdjuster() *Adjuster

func (*Adjuster) CalculateNextDifficulty

func (a *Adjuster) CalculateNextDifficulty(lastBlockTime int64, currentDifficulty uint32) uint32

type Target

type Target struct {
	// contains filtered or unexported fields
}

func NewTarget

func NewTarget() *Target

func (*Target) Bits

func (t *Target) Bits() uint32

func (*Target) SetCompact

func (t *Target) SetCompact(bits uint32)

Jump to

Keyboard shortcuts

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