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 // 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.