mempool

package
v0.0.0-...-7abacdd Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxPool

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

TxPool contains valid transactions that may be included in the next block.

func NewTxPool

func NewTxPool() *TxPool

NewTxPool returns a new transaction pool.

func (*TxPool) Add

func (t *TxPool) Add(tx tx.Tx)

Add adds a transaction to the pool.

func (*TxPool) Contains

func (t *TxPool) Contains(txID []byte) bool

Contains returns whether the txID is in the pool or not.

func (*TxPool) Count

func (t *TxPool) Count() int

Count returns the number of transactions in the pool.

func (*TxPool) ForEach

func (t *TxPool) ForEach(f func(txID string, tx tx.Tx) error) error

ForEach iterates over the pool executing f on each transaction.

func (*TxPool) Get

func (t *TxPool) Get(txID []byte) tx.Tx

Get retrieves a transaction from the pool.

func (*TxPool) Remove

func (t *TxPool) Remove(txID []byte)

Remove deletes a transaction from the pool.

func (*TxPool) SizeBytes

func (t *TxPool) SizeBytes() (int, error)

SizeBytes returns the size of the mempool in bytes.

Jump to

Keyboard shortcuts

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