block

package
v0.0.0-...-eb21b60 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RewardBase        uint64 = 2 << 4
	HashSize                 = 32
	VarianceChunkSize        = 2 << 16
)
View Source
const (
	BlockEpoch = 16.0
)

Variables

This section is empty.

Functions

func BlockReward

func BlockReward(complexity uint64, transactions []transaction.TX) uint64

func HashQuality

func HashQuality(complexity uint64) uint64

Types

type Block

type Block struct {
	Chain        uint64
	Index        uint64
	Complexity   uint64
	Timestamp    uint64
	Variance     uint64
	PreviousHash []byte
	Data         []transaction.TX
}

func Find

func Find(init Block) Block

func Genesis

func Genesis(chain, complexity uint64, creator *account.Private) Block

func New

func New() Block

func Next

func Next(prev Block) Block

func (Block) Append

func (b Block) Append(tx transaction.TX) Block

func (Block) Bytes

func (b Block) Bytes() []byte

func (Block) Compliant

func (b Block) Compliant() bool

Compliant if the block is compliant to the hash quality requirements for this complexity step.

func (Block) Fingerprint

func (b Block) Fingerprint() string

func (Block) Hash

func (b Block) Hash() []byte

func (Block) HashString

func (b Block) HashString() string

func (Block) SetBytes

func (b Block) SetBytes(data []byte) Block

func (Block) SetBytesFrom

func (b Block) SetBytesFrom(source io.Reader) Block

func (Block) String

func (b Block) String() string

func (Block) SuccessorOf

func (b Block) SuccessorOf(prev Block) error

SuccessorOf returns true if this block is the direct successor of the given block.

func (Block) Verify

func (b Block) Verify(fallback *btree.BTree) (*btree.BTree, error)

Jump to

Keyboard shortcuts

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