types

package
v0.0.0-...-2e8d15a Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	ParentHash string
	MsgHash    []message
}

func GeneisBlock

func GeneisBlock() *Block

func NewBlock

func NewBlock(header *Header, msgs []*message) *Block

添加新区块

func (Block) MerkleRoot

func (b Block) MerkleRoot() crypto.Hash

计算默克尔树

func (Block) PrevHash

func (b Block) PrevHash() string
type Header struct {
	ParentHash string
	Version    int8
	MerkleRoot crypto.Hash
	Timestamp  time.Time
}

func (Header) CalculateHashForBlock

func (bh Header) CalculateHashForBlock() string

计算当前区块Hash

Jump to

Keyboard shortcuts

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