Documentation
¶
Index ¶
- Variables
- type BroadcastedTransaction
- type Pool
- func (p *Pool) Close()
- func (p *Pool) Len() int
- func (p *Pool) LenDB() (int, error)
- func (p *Pool) LoadFromDB() error
- func (p *Pool) Pop() (BroadcastedTransaction, error)
- func (p *Pool) PopBatch(numToPop int) ([]BroadcastedTransaction, error)
- func (p *Pool) Push(userTxn *BroadcastedTransaction) error
- func (p *Pool) Remove(hash ...*felt.Felt) error
- func (p *Pool) Wait() <-chan struct{}
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTxnPoolFull = errors.New("transaction pool is full") ErrTxnPoolEmpty = errors.New("transaction pool is empty") )
Functions ¶
This section is empty.
Types ¶
type BroadcastedTransaction ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a blockchain mempool, managing transactions using both an in-memory and persistent database.
func New ¶
func New(mainDB db.DB, bc blockchain.Reader, maxNumTxns int, log utils.SimpleLogger) *Pool
New initialises the Pool and starts the database writer goroutine. It is the responsibility of the caller to execute the closer function.
func (*Pool) LoadFromDB ¶
LoadFromDB restores the in-memory transaction pool from the database
func (*Pool) Pop ¶
func (p *Pool) Pop() (BroadcastedTransaction, error)
Pop returns the transaction with the highest priority from the in-memory pool
func (*Pool) PopBatch ¶ added in v0.14.4
func (p *Pool) PopBatch(numToPop int) ([]BroadcastedTransaction, error)
PopBatch returns a batch of transactions with the highest priority from the in-memory pool
func (*Pool) Push ¶
func (p *Pool) Push(userTxn *BroadcastedTransaction) error
Push queues a transaction to the pool
Click to show internal directories.
Click to hide internal directories.