Documentation
¶
Overview ¶
Package api defines the transaction pool interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MaxPoolSize uint64
WeightLimits map[transaction.Weight]uint64
}
Config is a transaction pool configuration.
type TxPool ¶
type TxPool interface {
// Name is the transaction pool implementation name.
Name() string
// Add adds a single transaction into the transaction pool.
Add(tx *transaction.CheckedTransaction) error
// GetBatch gets a transaction batch from the transaction pool.
GetBatch(force bool) []*transaction.CheckedTransaction
// GetPrioritizedBatch returns a batch of transactions ordered by priority but without taking
// any weight limits into account.
//
// Offset specifies the transaction hash that should serve as an offset when returning
// transactions from the pool. Transactions will be skipped until the given hash is encountered
// and only following transactions will be returned.
GetPrioritizedBatch(offset *hash.Hash, limit uint32) []*transaction.CheckedTransaction
// RemoveBatch removes a batch from the transaction pool.
RemoveBatch(batch []hash.Hash) error
// IsQueued returns whether a transaction is in the queue already.
IsQueued(txHash hash.Hash) bool
// Size returns the number of transactions in the transaction pool.
Size() uint64
// UpdateConfig updates the transaction pool config.
UpdateConfig(Config) error
// Clear clears the transaction pool.
Clear()
}
TxPool is the transaction pool interface.
Click to show internal directories.
Click to hide internal directories.