btc

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: LGPL-3.0 Imports: 17 Imported by: 0

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