helpers

package
v0.1.8-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DifficultyBoundDivisor is the bound divisor of the difficulty,
	// used in the update calculations.
	DifficultyBoundDivisor = big.NewInt(2048)

	// DurationLimit is the decision boundary on the blocktime duration used to
	// determine whether difficulty should go up or not.
	DurationLimit = big.NewInt(120)

	// MinimumDifficulty is the minimum that the difficulty may ever be.
	MinimumDifficulty = big.NewInt(100000)

	// MinimumDurationIncrease is the minimum percent increase
	// of a new block time in relation to its parent block time.
	// Formula: (((DurationLimit+1)-DurationLimit)/DurationLimit) * 100
	MinimumDurationIncrease = big.NewFloat(0.8)
)

Functions

func CalcDifficultyInception

func CalcDifficultyInception(time uint64, parent *Block) *big.Int

func RoundFloat

func RoundFloat(x *big.Float)

RoundFloat rounds x

Types

type Block

type Block struct {
	Number     uint64
	Timestamp  time.Time
	Difficulty *big.Int
}

Block represents a block

Jump to

Keyboard shortcuts

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