Documentation ¶
Index ¶
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
}
TransactionPool is a thread-safe container for transactions that received from the network or submitted locally. A transaction will be removed from the pool once included in a blockchain.
func NewTransactionPool ¶
func NewTransactionPool(config TransactionPoolConfig) *TransactionPool
NewTransactionPool creates and returns a transaction pool.
func (*TransactionPool) AddTransaction ¶
func (pool *TransactionPool) AddTransaction(tx *types.Transaction) (bool, error)
AddTransaction adds a single transation into the pool if it is valid and return true. Otherwise, return false and concrete error.
type TransactionPoolConfig ¶
type TransactionPoolConfig struct {
Capacity uint // Maximum number of transactions in pool.
}
TransactionPoolConfig is the configuration of transaction pool.
func DefaultTxPoolConfig ¶
func DefaultTxPoolConfig() *TransactionPoolConfig
DefaultTxPoolConfig returns the default configuration of transaction pool.
Click to show internal directories.
Click to hide internal directories.