Documentation ¶
Index ¶
- Constants
- type Block
- func (bl *Block) Decode(r io.Reader) error
- func (bl *Block) Encode(w io.Writer) error
- func (bl *Block) EncodeSize() int
- func (bl *Block) GetBlockHeader() BlockHeader
- func (bl *Block) GetHash() util.Hash
- func (bl *Block) Serialize(w io.Writer) error
- func (bl *Block) SerializeSize() int
- func (bl *Block) SetNull()
- func (bl *Block) Unserialize(r io.Reader) error
- type BlockFileInfo
- func (bfi *BlockFileInfo) AddBlock(nHeightIn int32, timeIn uint64)
- func (bfi *BlockFileInfo) GetSerializeList() []string
- func (bfi *BlockFileInfo) Serialize(w io.Writer) error
- func (bfi *BlockFileInfo) SetNull()
- func (bfi *BlockFileInfo) String() string
- func (bfi *BlockFileInfo) Unserialize(r io.Reader) error
- type BlockHeader
- func (bh *BlockHeader) Decode(r io.Reader) error
- func (bh *BlockHeader) Encode(w io.Writer) error
- func (bh *BlockHeader) EncodeSize() int
- func (bh *BlockHeader) GetHash() util.Hash
- func (bh *BlockHeader) GetSerializeList() []string
- func (bh *BlockHeader) IsNull() bool
- func (bh *BlockHeader) Serialize(w io.Writer) error
- func (bh *BlockHeader) SerializeSize() int
- func (bh *BlockHeader) SetNull()
- func (bh *BlockHeader) String() string
- func (bh *BlockHeader) Unserialize(r io.Reader) error
- type DiskBlockPos
- type DiskTxPos
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 NewGenesisBlock ¶
func NewGenesisBlock() *Block
func NewRegTestGenesisBlock ¶
func NewRegTestGenesisBlock() *Block
func NewTestNetGenesisBlock ¶
func NewTestNetGenesisBlock() *Block
func (*Block) EncodeSize ¶
func (*Block) GetBlockHeader ¶
func (bl *Block) GetBlockHeader() BlockHeader
func (*Block) SerializeSize ¶
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) 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) 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) 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 ¶
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) 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
Click to show internal directories.
Click to hide internal directories.