Documentation ¶
Index ¶
- type TransactionPool
- func (tp *TransactionPool) AcceptTransactionSet(ts []types.Transaction) error
- func (tp *TransactionPool) Close() error
- func (tp *TransactionPool) ProcessConsensusChange(cc modules.ConsensusChange)
- func (tp *TransactionPool) PurgeTransactionPool()
- func (tp *TransactionPool) Transaction(id types.TransactionID) (types.Transaction, error)
- func (tp *TransactionPool) TransactionList() []types.Transaction
- func (tp *TransactionPool) TransactionPoolSubscribe(subscriber modules.TransactionPoolSubscriber)
- func (tp *TransactionPool) Unsubscribe(subscriber modules.TransactionPoolSubscriber)
- func (tp *TransactionPool) ValidateTransactionSetSize(ts []types.Transaction) error
- type TransactionSetID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TransactionPool ¶
type TransactionPool struct {
// contains filtered or unexported fields
}
The TransactionPool tracks incoming transactions, accepting them or rejecting them based on internal criteria such as fees and unconfirmed double spends.
func New ¶
func New(cs modules.ConsensusSet, g modules.Gateway, persistDir string, bcInfo types.BlockchainInfo, chainCts types.ChainConstants, verbose bool) (*TransactionPool, error)
New creates a transaction pool that is ready to receive transactions.
func (*TransactionPool) AcceptTransactionSet ¶
func (tp *TransactionPool) AcceptTransactionSet(ts []types.Transaction) error
AcceptTransactionSet adds a transaction to the unconfirmed set of transactions. If the transaction is accepted, it will be relayed to connected peers.
func (*TransactionPool) Close ¶
func (tp *TransactionPool) Close() error
func (*TransactionPool) ProcessConsensusChange ¶
func (tp *TransactionPool) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange gets called to inform the transaction pool of changes to the consensus set.
func (*TransactionPool) PurgeTransactionPool ¶
func (tp *TransactionPool) PurgeTransactionPool()
PurgeTransactionPool deletes all transactions from the transaction pool.
func (*TransactionPool) Transaction ¶ added in v1.0.7
func (tp *TransactionPool) Transaction(id types.TransactionID) (types.Transaction, error)
Transaction implements TransactionPool.Transaction
func (*TransactionPool) TransactionList ¶
func (tp *TransactionPool) TransactionList() []types.Transaction
TransactionList returns a list of all transactions in the transaction pool. The transactions are provided in an order that can acceptably be put into a block.
func (*TransactionPool) TransactionPoolSubscribe ¶
func (tp *TransactionPool) TransactionPoolSubscribe(subscriber modules.TransactionPoolSubscriber)
TransactionPoolSubscribe adds a subscriber to the transaction pool. Subscribers will receive the full transaction set every time there is a significant change to the transaction pool.
func (*TransactionPool) Unsubscribe ¶
func (tp *TransactionPool) Unsubscribe(subscriber modules.TransactionPoolSubscriber)
Unsubscribe removes a subscriber from the transaction pool. If the subscriber is not in tp.subscribers, Unsubscribe does nothing. If the subscriber occurs more than once in tp.subscribers, only the earliest occurrence is removed (unsubscription fails).
func (*TransactionPool) ValidateTransactionSetSize ¶ added in v1.2.0
func (tp *TransactionPool) ValidateTransactionSetSize(ts []types.Transaction) error
ValidateTransactionSetSize validates that all transacitons are within the size limits as defined by the transaction pool constants.
type TransactionSetID ¶
TransactionSetID is the hash of a transaction set.