block

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: BSD-2-Clause Imports: 7 Imported by: 62

Documentation

Index

Constants

View Source
const MinBlocksToKeep = int32(288)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Header BlockHeader
	Txs    []*tx.Tx

	Checked bool
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock() *Block

func NewGenesisBlock

func NewGenesisBlock() *Block

func NewRegTestGenesisBlock

func NewRegTestGenesisBlock() *Block

func NewTestNetGenesisBlock

func NewTestNetGenesisBlock() *Block

func (*Block) Decode

func (bl *Block) Decode(r io.Reader) error

func (*Block) Encode

func (bl *Block) Encode(w io.Writer) error

func (*Block) EncodeSize

func (bl *Block) EncodeSize() int

func (*Block) GetBlockHeader

func (bl *Block) GetBlockHeader() BlockHeader

func (*Block) GetHash

func (bl *Block) GetHash() util.Hash

func (*Block) Serialize

func (bl *Block) Serialize(w io.Writer) error

func (*Block) SerializeSize

func (bl *Block) SerializeSize() int

func (*Block) SetNull

func (bl *Block) SetNull()

func (*Block) Unserialize

func (bl *Block) Unserialize(r io.Reader) error

type BlockFileInfo

type BlockFileInfo struct {
	Blocks      uint32 // number of blocks stored in file
	Size        uint32 // number of used bytes of block file
	UndoSize    uint32 // number of used bytes in the undo file
	HeightFirst int32  // lowest height of block in file
	HeightLast  int32  // highest height of block in file
	// contains filtered or unexported fields
}

func NewBlockFileInfo

func NewBlockFileInfo() *BlockFileInfo

func (*BlockFileInfo) AddBlock

func (bfi *BlockFileInfo) AddBlock(nHeightIn int32, timeIn uint64)

func (*BlockFileInfo) GetSerializeList

func (bfi *BlockFileInfo) GetSerializeList() []string

func (*BlockFileInfo) Serialize

func (bfi *BlockFileInfo) Serialize(w io.Writer) error

func (*BlockFileInfo) SetNull

func (bfi *BlockFileInfo) SetNull()

func (*BlockFileInfo) String

func (bfi *BlockFileInfo) String() string

func (*BlockFileInfo) Unserialize

func (bfi *BlockFileInfo) Unserialize(r io.Reader) error

type BlockHeader

type BlockHeader struct {
	Version       int32     `json:"version"`
	HashPrevBlock util.Hash `json:"previousblockhash,string"`
	MerkleRoot    util.Hash `json:"merkleroot,string"`
	Time          uint32    `json:"time"`
	Bits          uint32    `json:"bits"`
	Nonce         uint32    `json:"nonce"`

	Hash util.Hash `json:"hash"`
	// contains filtered or unexported fields
}

func NewBlockHeader

func NewBlockHeader() *BlockHeader

func (*BlockHeader) Decode

func (bh *BlockHeader) Decode(r io.Reader) error

func (*BlockHeader) Encode

func (bh *BlockHeader) Encode(w io.Writer) error

func (*BlockHeader) EncodeSize

func (bh *BlockHeader) EncodeSize() int

func (*BlockHeader) GetHash

func (bh *BlockHeader) GetHash() util.Hash

func (*BlockHeader) GetSerializeList

func (bh *BlockHeader) GetSerializeList() []string

func (*BlockHeader) IsNull

func (bh *BlockHeader) IsNull() bool

func (*BlockHeader) Serialize

func (bh *BlockHeader) Serialize(w io.Writer) error

func (*BlockHeader) SerializeSize

func (bh *BlockHeader) SerializeSize() int

func (*BlockHeader) SetNull

func (bh *BlockHeader) SetNull()

func (*BlockHeader) String

func (bh *BlockHeader) String() string

func (*BlockHeader) Unserialize

func (bh *BlockHeader) Unserialize(r io.Reader) error

type DiskBlockPos

type DiskBlockPos struct {
	File int32
	Pos  uint32
}

func NewDiskBlkPos

func NewDiskBlkPos() DiskBlockPos

func NewDiskBlockPos

func NewDiskBlockPos(file int32, pos uint32) *DiskBlockPos

func (*DiskBlockPos) Equal

func (dbp *DiskBlockPos) Equal(other *DiskBlockPos) bool

func (*DiskBlockPos) IsNull

func (dbp *DiskBlockPos) IsNull() bool

func (*DiskBlockPos) Serialize

func (dbp *DiskBlockPos) Serialize(writer io.Writer) error

func (*DiskBlockPos) SetNull

func (dbp *DiskBlockPos) SetNull()

func (*DiskBlockPos) String

func (dbp *DiskBlockPos) String() string

func (*DiskBlockPos) Unserialize

func (dbp *DiskBlockPos) Unserialize(reader io.Reader) error

type DiskTxPos

type DiskTxPos struct {
	BlockIn    *DiskBlockPos
	TxOffsetIn uint32
}

func NewDiskTxPos

func NewDiskTxPos(blockIn *DiskBlockPos, offsetIn uint32) *DiskTxPos

func (*DiskTxPos) Serialize

func (dtp *DiskTxPos) Serialize(writer io.Writer) error

func (*DiskTxPos) Unserialize

func (dtp *DiskTxPos) Unserialize(reader io.Reader) error

Jump to

Keyboard shortcuts

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