Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BtcScanner ¶
type BtcScanner struct { // connect to BTC node BtcClient btcclient.BTCClient // the BTC height the scanner starts BaseHeight uint64 // the BTC confirmation depth K uint64 ConfirmedBlocksChan chan *types.IndexedBlock // cache of a sequence of unconfirmed blocks UnconfirmedBlockCache *types.BTCCache Synced *atomic.Bool Started *atomic.Bool // contains filtered or unexported fields }
func New ¶
func New(btcCfg *config.BTCConfig, monitorCfg *config.MonitorConfig, btcClient btcclient.BTCClient, btclightclientBaseHeight uint64, tagID uint8) (*BtcScanner, error)
func (*BtcScanner) Bootstrap ¶
func (bs *BtcScanner) Bootstrap()
Bootstrap syncs with BTC by getting the confirmed blocks and the caching the unconfirmed blocks
func (*BtcScanner) GetCheckpointsChan ¶
func (bs *BtcScanner) GetCheckpointsChan() chan *types.CheckpointRecord
func (*BtcScanner) GetHeadersChan ¶
func (bs *BtcScanner) GetHeadersChan() chan *wire.BlockHeader
func (*BtcScanner) Start ¶
func (bs *BtcScanner) Start()
Start starts the scanning process from curBTCHeight to tipHeight
func (*BtcScanner) Stop ¶
func (bs *BtcScanner) Stop()
type Scanner ¶
type Scanner interface { Start() GetCheckpointsChan() chan *types.CheckpointRecord GetHeadersChan() chan *wire.BlockHeader Stop() }
Click to show internal directories.
Click to hide internal directories.