txfee

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: BlueOak-1.0.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeeFetchFunc

type FeeFetchFunc func(ctx context.Context) (rate uint64, errDelay time.Duration, err error)

FeeFetchFunc is a function that fetches a fee rate. If an error is encountered the FeeFetchFunc will indicate how long to wait until trying again.

type FeeFetcher

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

func NewFeeFetcher

func NewFeeFetcher(sources []*SourceConfig, log dex.Logger) *FeeFetcher

NewFeeFetcher creates and returns a new FeeFetcher.

func (*FeeFetcher) Connect

func (f *FeeFetcher) Connect(ctx context.Context) (*sync.WaitGroup, error)

func (*FeeFetcher) Next

func (f *FeeFetcher) Next() <-chan uint64

type SourceConfig

type SourceConfig struct {
	F      FeeFetchFunc
	Name   string
	Period time.Duration
	// Rank controls which priority group the source is in. Lower Rank is higher
	// priority. Fee rates from similarly-ranked sources are grouped together
	// for a composite rate. Lower-ranked groups are not considered at all
	// until all sources from higher ranked groups are error or expired.
	Rank uint
}

SourceConfig defines a fee rate source.

Jump to

Keyboard shortcuts

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