sync

package
v0.0.0-...-ddb1edc Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelsWatcher

type ChannelsWatcher struct {
	// contains filtered or unexported fields
}

ChannelsWatcher contains all the data that is needed in order to scan several input scripts using neutrino compact filters download and matching. This is usefull to run as a background job that scans periodically all the user opened channels funding points, detect a possible closed channel and warn the user if a the channel was ulitirally found.

func NewChannelsWatcher

func NewChannelsWatcher(
	workingDir string,
	chainService *neutrino.ChainService,
	log btclog.Logger,
	db *jobDB,
	quitChan chan struct{}) (*ChannelsWatcher, error)

NewChannelsWatcher creates a new ChannelsWatcher. First it makes sure it has a valid ChainService and then fetches all the input scripts from the user channels needed to be watched.

func (*ChannelsWatcher) Scan

func (b *ChannelsWatcher) Scan(tipHeight uint64) (bool, error)

Scan scans from the last saved point up to the tipHeight given as parameter. it scans for all watchedScripts and if the ChainService notifies on a filter match this function returns true to reflect that a closed channel was detected and the user should be warned.

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job contains a running job info.

func NewJob

func NewJob(workingDir string) (*Job, error)

NewJob crates a new SyncJob and given a directory for this job. It is assumed that a config file exists in this directory.

func (*Job) Run

func (s *Job) Run() (channelClosed bool, err error)

Run executes the download filter operation synchronousely

func (*Job) Stop

func (s *Job) Stop()

Stop stops neutrino instance and wait for the syncFitlers to complete

Jump to

Keyboard shortcuts

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