mempool

package
v1.14.1-db-metrics-fix Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: BSD-3-Clause Imports: 18 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotEnoughGas = errors.New("not enough gas")
)

Functions

This section is empty.

Types

type Mempool

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

func New added in v1.10.16

func New(
	namespace string,
	weights gas.Dimensions,
	gasCapacity gas.Gas,
	avaxAssetID ids.ID,
	registerer prometheus.Registerer,
) (*Mempool, error)

func (*Mempool) Add

func (m *Mempool) Add(tx *txs.Tx) error

Add adds `tx` to the mempool and clears its dropped status.

func (*Mempool) Get

func (m *Mempool) Get(txID ids.ID) (*txs.Tx, bool)

Get returns the tx corresponding to `txID` and if it was present

func (*Mempool) GetDropReason

func (m *Mempool) GetDropReason(txID ids.ID) error

GetDropReason returns why `txID` was dropped

func (*Mempool) Iterate added in v1.10.18

func (m *Mempool) Iterate(f func(tx *txs.Tx) bool)

Iterate calls `f` over each tx in the mempool

func (*Mempool) Len added in v1.10.18

func (m *Mempool) Len() int

Len returns the number of txs in the mempool

func (*Mempool) MarkDropped

func (m *Mempool) MarkDropped(txID ids.ID, reason error)

MarkDropped marks `txID` as dropped

func (*Mempool) Peek added in v1.10.18

func (m *Mempool) Peek() (*txs.Tx, bool)

Peek returns a tx in the mempool and if it was present

func (*Mempool) Remove added in v1.8.0

func (m *Mempool) Remove(txID ids.ID)

Remove removes `txID` from the mempool

func (*Mempool) RemoveConflicts

func (m *Mempool) RemoveConflicts(utxos set.Set[ids.ID])

RemoveConflicts removes all txs conflicting with `utxos`

func (*Mempool) WaitForEvent

func (m *Mempool) WaitForEvent(ctx context.Context) (common.Message, error)

WaitForEvent blocks until the mempool has txs that are ready to build into a block.

Jump to

Keyboard shortcuts

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