Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTxnPoolFull = errors.New("transaction pool is full")
Functions ¶
This section is empty.
Types ¶
type BroadcastedTransaction ¶
type BroadcastedTransaction struct { Transaction core.Transaction DeclaredClass core.Class }
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, state core.StateReader, maxNumTxns int, log utils.SimpleLogger) (*Pool, func() error)
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) 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.