block

package
v0.0.0-...-94b93b3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Doublesha256BlockHeader

func Doublesha256BlockHeader(bh Header) string

Doublesha256BlockHeader returns a string representation of doubled-hashed block header

Types

type Header struct {
	Version       byte   //Block Version Number. Decimal format. 4 bytes Little Endian format originally.
	HashPrevBlock string //256bits Hash of the previous block header
	HashMerkRoot  string //256bits Hash on all of the transactions in the block
	Time          uint32 //Timestamp - Epoch time
	Bits          uint32 //Current target calculated with difficulty. Temporary string representation for testing.
	Nonce         uint32 //32Bits number - iterator
}

Header structure

func MakeSemiRandomBlockHeader

func MakeSemiRandomBlockHeader(version byte, currentTime uint32) Header

MakeSemiRandomBlockHeader makes a semi-random block header. Uses pre-defined time and version. Faster to generate than fully random blockheader.

func (*Header) Validate

func (block *Header) Validate() error

Validate a block header Difficulty is not checked since we might need to check older block. Nonce neither as it starts at 0.

Jump to

Keyboard shortcuts

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