mempool

package
v3.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxTx = 5000

Functions

This section is empty.

Types

type FifoMempool

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

FifoMempool is a mempool implementation that maintains two separate transaction pools: one for oracle transactions and another for regular transactions. Oracle transactions are given priority during iteration.

Key characteristics: 1. Maintains two separate FIFO queues (CList) for transactions (oracle and regular) 2. Uses sync.Map for quick transaction lookup 3. During iteration:

  • Oracle transactions are processed first in FIFO order
  • Regular transactions follow in FIFO order

4. Transaction capacity is limited by maxTx (if > 0)

Note: PrepareProposal may terminate iteration early if block size limits are reached.

func NewFifoMempool

func NewFifoMempool(opts ...FifoMempoolOptions) *FifoMempool

func (*FifoMempool) CountTx

func (mp *FifoMempool) CountTx() int

func (*FifoMempool) Insert

func (mp *FifoMempool) Insert(_ context.Context, tx sdk.Tx) error

func (*FifoMempool) Remove

func (mp *FifoMempool) Remove(tx sdk.Tx) error

func (*FifoMempool) Select

func (mp *FifoMempool) Select(_ context.Context, _ [][]byte) mempool.Iterator

type FifoMempoolOptions

type FifoMempoolOptions func(mp *FifoMempool)

func FifoMaxTxOpt

func FifoMaxTxOpt(maxTx int) FifoMempoolOptions

Jump to

Keyboard shortcuts

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