chain

package
v0.0.0-...-33416f3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DifficultyAdjuster

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

DifficultyAdjuster handles difficulty adjustments

func NewDifficultyAdjuster

func NewDifficultyAdjuster(config *Config) *DifficultyAdjuster

func (*DifficultyAdjuster) CalculateNextDifficulty

func (d *DifficultyAdjuster) CalculateNextDifficulty(lastBlock *block.Block, blocks []*block.Block) uint32

type FeeCalculator

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

FeeCalculator handles transaction fee calculations

func NewFeeCalculator

func NewFeeCalculator(minFeeRate, maxFeeRate float64) *FeeCalculator

func (*FeeCalculator) CalculateMinFee

func (f *FeeCalculator) CalculateMinFee(txSize int) float64

func (*FeeCalculator) ValidateFee

func (f *FeeCalculator) ValidateFee(fee float64, txSize int) bool

type RewardCalculator

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

RewardCalculator handles mining reward calculations

func NewRewardCalculator

func NewRewardCalculator(config *Config) *RewardCalculator

func (*RewardCalculator) CalculateBlockReward

func (r *RewardCalculator) CalculateBlockReward(height uint64) float64

type State

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

State manages blockchain state

func NewState

func NewState() *State

func (*State) AddBlock

func (s *State) AddBlock(block *block.Block) error

Jump to

Keyboard shortcuts

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