csdrivers

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

Types

type DcrwalletCSDriver

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

DcrwalletCSDriver...

NOTE: Using an individual driver instance for more than either a single historical or tip watcher scanner leads to undefined behavior.

func NewDcrwalletCSDriver

func NewDcrwalletCSDriver(w *wallet.Wallet) *DcrwalletCSDriver

func (*DcrwalletCSDriver) ChainEvents

func (d *DcrwalletCSDriver) ChainEvents(ctx context.Context) <-chan chainscan.ChainEvent

func (*DcrwalletCSDriver) CurrentTip

func (d *DcrwalletCSDriver) CurrentTip(ctx context.Context) (*chainhash.Hash, int32, error)

func (*DcrwalletCSDriver) GetBlock

func (d *DcrwalletCSDriver) GetBlock(ctx context.Context, bh *chainhash.Hash) (*wire.MsgBlock, error)

GetBlock returns the given block for the given blockhash. Note that for wallets running in SPV mode this blocks until the wallet is connected to a peer and it correctly returns a full block.

func (*DcrwalletCSDriver) GetCFilter

func (d *DcrwalletCSDriver) GetCFilter(ctx context.Context, height int32) (*chainhash.Hash, [16]byte, *gcs.FilterV2, error)

GetCFilter is part of the chainscan.HistoricalChainSource interface.

NOTE: The returned chainhash pointer is not safe for storage as it belongs to a cache entry. This is fine for use on a chainscan.Historical scanner since it never stores or leaks the pointer itself.

func (*DcrwalletCSDriver) Run

func (d *DcrwalletCSDriver) Run(ctx context.Context) error

Run runs the driver. It should be executed on a separate goroutine. This is only needed if the NextTip() function is going to be used such as when using this driver as a source for a TipWatcher scanner.

type RemoteWalletCSDriver

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

func (*RemoteWalletCSDriver) ChainEvents

func (d *RemoteWalletCSDriver) ChainEvents(ctx context.Context) <-chan chainscan.ChainEvent

func (*RemoteWalletCSDriver) CurrentTip

func (d *RemoteWalletCSDriver) CurrentTip(ctx context.Context) (*chainhash.Hash, int32, error)

func (*RemoteWalletCSDriver) GetBlock

func (*RemoteWalletCSDriver) GetCFilter

func (d *RemoteWalletCSDriver) GetCFilter(ctx context.Context, height int32) (*chainhash.Hash, [16]byte, *gcs.FilterV2, error)

GetCFilter is part of the chainscan.HistoricalChainSource interface.

NOTE: The returned chainhash pointer is not safe for storage as it belongs to a cache entry. This is fine for use on a chainscan.Historical scanner since it never stores or leaks the pointer itself.

func (*RemoteWalletCSDriver) Run

Jump to

Keyboard shortcuts

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