minerlist

package
v0.0.0-...-685dfbd Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinerListContract = "UmixYUgBHA9vJj47myQKn8uZAm4anEfrG78"

	PreQrLength = 97
)

Variables

This section is empty.

Functions

func CalIdTarget

func CalIdTarget(preCoinbase common.Address, preSignatureQr []byte, blockNumber *big.Int, totalMinerNum *big.Int, state *state.StateDB) *big.Int

func CalQrOrIdNext

func CalQrOrIdNext(base []byte, number *big.Int, preQr []byte) (common.Hash, error)

func GetMisconducts

func GetMisconducts(statedb *state.StateDB, miner common.Address) *big.Int

func GetPunishHeight

func GetPunishHeight(statedb *state.StateDB, miner common.Address) *big.Int

func IsMiner

func IsMiner(statedb *state.StateDB, miner common.Address, totalMinerNum *big.Int, blockNumber *big.Int) (bool, int)

Return whether the miner is legal or not "legal" means the right to participate in mining Not whether the miners are online but whether the miners are being punished 0 means miners, 1 means punished, 2 means not on the miners' list

func IsPunishedMiner

func IsPunishedMiner(statedb *state.StateDB, miner common.Address, totalMinerNum *big.Int, blockNumber *big.Int) bool

Return whether the miner is legal or not "legal" means the right to participate in mining

func IsValidMiner

func IsValidMiner(state *state.StateDB, miner common.Address, preCoinbase common.Address, preSignatureQr []byte, blockNumber *big.Int, totalMinerNum *big.Int, offset *big.Int) (bool, int64, int64)

Return whether the miner is valid or not , difficultlevel and preMinerid

func ReadMinerAddress

func ReadMinerAddress(statedb *state.StateDB, offset int64) []byte

func ReadMinerNum

func ReadMinerNum(statedb *state.StateDB) *big.Int

Return the number of miner

Types

This section is empty.

Jump to

Keyboard shortcuts

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