mempool

package
v0.10.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFn

type CheckFn func(ctx context.Context, tx *ktypes.Transaction) error

type Mempool

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

func New

func New() *Mempool

func (*Mempool) Get

func (mp *Mempool) Get(txid types.Hash) *ktypes.Transaction

func (*Mempool) Have

func (mp *Mempool) Have(txid types.Hash) bool

func (*Mempool) PeekN

func (mp *Mempool) PeekN(n int) []types.NamedTx

func (*Mempool) PreFetch

func (mp *Mempool) PreFetch(txid types.Hash) bool

func (*Mempool) ReapN

func (mp *Mempool) ReapN(n int) []types.NamedTx

ReapN extracts the first n transactions in the queue

func (*Mempool) RecheckTxs

func (mp *Mempool) RecheckTxs(ctx context.Context, fn CheckFn)

func (*Mempool) Remove

func (mp *Mempool) Remove(txid types.Hash)

func (*Mempool) Size

func (mp *Mempool) Size() int

func (*Mempool) Store

func (mp *Mempool) Store(txid types.Hash, tx *ktypes.Transaction) (found bool)

Store adds a transaction to the mempool. If the transaction is already in the mempool, it returns true indicating that the transaction is already in the mempool.

func (*Mempool) TxsAvailable

func (mp *Mempool) TxsAvailable() bool

Jump to

Keyboard shortcuts

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