epochs

package
v0.33.27 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: AGPL-3.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransactionPools

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

TransactionPools is a set of epoch-scoped transaction pools. Each pool is a singleton that is instantiated the first time a transaction pool for that epoch is requested.

This enables decoupled components to share access to the same transaction pools across epochs, while maintaining the property that one transaction pool is only valid for a single epoch.

func NewTransactionPools

func NewTransactionPools(create func(uint64) mempool.Transactions) *TransactionPools

NewTransactionPools returns a new set of epoch-scoped transaction pools.

func (*TransactionPools) CombinedSize

func (t *TransactionPools) CombinedSize() uint

CombinedSize returns the sum of the sizes of all transaction pools.

func (*TransactionPools) ForEpoch

func (t *TransactionPools) ForEpoch(epoch uint64) mempool.Transactions

ForEpoch returns the transaction pool for the given pool. All calls for the same epoch will return the same underlying transaction pool.

Jump to

Keyboard shortcuts

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