extpool

package
v0.119.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidHeight is returned when Extensible message height is above the
	// current chain's height.
	ErrInvalidHeight = errors.New("invalid height")
)

Functions

This section is empty.

Types

type Ledger added in v0.98.1

type Ledger interface {
	BlockHeight() uint32
	GetConfig() config.Blockchain
	GetMillisecondsPerBlock() uint32
	IsExtensibleAllowed(util.Uint160) bool
	VerifyWitness(util.Uint160, hash.Hashable, *transaction.Witness, int64) (int64, error)
}

Ledger is enough of Blockchain to satisfy Pool.

type Pool

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

Pool represents a pool of extensible payloads.

func New

func New(bc Ledger, capacity int, resendFunc func([]util.Uint256)) *Pool

New returns a new payload pool using the provided chain.

func (*Pool) Add

func (p *Pool) Add(e *payload.Extensible) (bool, error)

Add adds an extensible payload to the pool. First return value specifies if the payload was new. Second one is nil if and only if the payload is valid. Add must not be called once the Pool is stopped.

func (*Pool) Get

func (p *Pool) Get(h util.Uint256) *payload.Extensible

Get returns payload by hash.

func (*Pool) GetCategory added in v0.119.0

func (p *Pool) GetCategory(category string) []util.Uint256

GetCategory returns the list of extensible hashes matching the specified category.

func (*Pool) RemoveStale

func (p *Pool) RemoveStale(index uint32)

RemoveStale removes invalid payloads after block processing. RemoveStale must not be called once the Pool is stopped.

func (*Pool) Start added in v0.119.0

func (p *Pool) Start()

Start starts the Pool's payload resend dispatcher. Caller should wait for Start to finish for normal operation.

func (*Pool) Stop added in v0.119.0

func (p *Pool) Stop()

Stop stops Pool's payload resend dispatcher and should be called only after it's guaranteed there will be no more calls to Add or RemoveStale.

Jump to

Keyboard shortcuts

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