price

package
v1.76.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: BSD-3-Clause Imports: 5 Imported by: 10 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *types.Mempool, sub []byte) queue.Module

New 创建price cache 结构的 mempool

Types

type Queue

type Queue struct {
	*skiplist.Queue
	// contains filtered or unexported fields
}

Queue 价格队列模式(价格=手续费/交易字节数,价格高者优先,同价则时间早优先)

func NewQueue

func NewQueue(subcfg subConfig) *Queue

NewQueue 创建队列

func (*Queue) GetItem

func (cache *Queue) GetItem(hash string) (*mempool.Item, error)

GetItem 获取数据通过 key

func (*Queue) GetProperFee

func (cache *Queue) GetProperFee() int64

GetProperFee 获取合适的手续费率,取前100的平均手续费率

func (*Queue) Push

func (cache *Queue) Push(item *mempool.Item) error

Push 加入数据到队列

func (*Queue) Walk

func (cache *Queue) Walk(count int, cb func(tx *mempool.Item) bool)

Walk 获取数据通过 key

Jump to

Keyboard shortcuts

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