btc

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: LGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHeader

func CheckHeader(native *native.NativeService, chainID uint64, header wire.BlockHeader, prevHeader *StoredHeader) (bool, error)

func GetBlockHashByHeight

func GetBlockHashByHeight(native *native.NativeService, chainID uint64, height uint32) (*chainhash.Hash, error)

func GetEpoch

func GetEpoch(native *native.NativeService, chainID uint64, sh *StoredHeader) (*wire.BlockHeader, error)

func ReIndexHeaderHeight

func ReIndexHeaderHeight(native *native.NativeService, chainID uint64, bestHeaderHeight uint32, hdrs []chainhash.Hash,
	newBlock *StoredHeader) error

Types

type BTCHandler

type BTCHandler struct {
}

func NewBTCHandler

func NewBTCHandler() *BTCHandler

func (*BTCHandler) SyncBlockHeader

func (this *BTCHandler) SyncBlockHeader(native *native.NativeService) error

func (*BTCHandler) SyncCrossChainMsg

func (this *BTCHandler) SyncCrossChainMsg(native *native.NativeService) error

func (*BTCHandler) SyncGenesisHeader

func (this *BTCHandler) SyncGenesisHeader(native *native.NativeService) error

type StoredHeader

type StoredHeader struct {
	Header wire.BlockHeader
	Height uint32
	// contains filtered or unexported fields
}

func GetBestBlockHeader

func GetBestBlockHeader(native *native.NativeService, chainID uint64) (*StoredHeader, error)

func GetCommonAncestor

func GetCommonAncestor(native *native.NativeService, chainID uint64, bestHeader, prevBestHeader *StoredHeader) (*StoredHeader, []chainhash.Hash, error)

func GetHeaderByHash

func GetHeaderByHash(native *native.NativeService, chainID uint64, hash chainhash.Hash) (*StoredHeader, error)

func GetHeaderByHeight

func GetHeaderByHeight(native *native.NativeService, chainID uint64, height uint32) (*StoredHeader, error)

func GetPreviousHeader

func GetPreviousHeader(native *native.NativeService, chainID uint64, header wire.BlockHeader) (*StoredHeader, error)

func (*StoredHeader) Deserialization

func (this *StoredHeader) Deserialization(source *common.ZeroCopySource) error

func (*StoredHeader) Serialization

func (this *StoredHeader) Serialization(sink *common.ZeroCopySink)

Jump to

Keyboard shortcuts

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