block

package
Version: v0.0.0-...-c37bf4f Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_TAG uint16 = 0xff00
)
View Source
const (
	BLOCK_VERSION = 1
)
View Source
const (
	HIGHEST_TARGET = 0x1d00ffff
)

Variables

This section is empty.

Functions

func Miner

func Miner(blockChan chan *Block, minedBlockChan chan *Block)

Types

type Block

type Block struct {
	Version           uint32
	PreviousBlockHash types.Hash
	MerkleRootHash    types.Hash
	Timestamp         int64
	Bits              uint32
	Nonce             uint32
	Transactions      []*trans.Envelope
}

func Decode

func Decode(encoded []byte) (*Block, error)

func NewBlock

func NewBlock(previousBlockHash types.Hash, bits uint32, transactions []*trans.Envelope) (*Block, error)

func (*Block) Encode

func (b *Block) Encode() ([]byte, error)

func (*Block) Hash

func (b *Block) Hash() types.Hash

func (*Block) MarshalJSON

func (b *Block) MarshalJSON() ([]byte, error)

func (*Block) String

func (b *Block) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL