package mempool

import "dejo_node/internal/transactions"

type Mempool struct {
	transactions []*transactions.Transaction
}

func NewMempool() *Mempool {
	return &Mempool{
		transactions: []*transactions.Transaction{},
	}
}

func (m *Mempool) Add(tx *transactions.Transaction) {
	m.transactions = append(m.transactions, tx)
}

func (m *Mempool) All() []*transactions.Transaction {
	return m.transactions
}

func (m *Mempool) Clear() {
	m.transactions = []*transactions.Transaction{}
}
