Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTxPoolConfig = TxPoolConfig{
GlobalSlots: 40960,
MaxTrsPerBlock: 20480,
TxMaxCacheTime: 600,
}
Functions ¶
func GetPoolNonce ¶
func GetTxByHash ¶
func GetTxByHash(hash types.Hash) *types.Transaction
Types ¶
type TxPool ¶
type TxPool struct {
// contains filtered or unexported fields
}
var GlobalTxsPool *TxPool
func (*TxPool) AddTx ¶
func (pool *TxPool) AddTx(tx *types.Transaction) error
Adding transaction to the txpool
func (*TxPool) DelTxs ¶
func (pool *TxPool) DelTxs(txs []*types.Transaction)
Update processing queue, clean txs from process and all queue.
func (*TxPool) GetTxs ¶
func (pool *TxPool) GetTxs() []*types.Transaction
Get pending txs from txpool.
type TxPoolConfig ¶
type TxPoolConfig struct { GlobalSlots uint64 // Maximum number of executable transaction slots for txpool MaxTrsPerBlock uint64 // Maximum num of transactions a block TxMaxCacheTime uint64 // Maximum cache time(second) of transactions in tx pool }
TxPoolConfig are the configuration parameters of the transaction pool.
type TxsPool ¶
type TxsPool interface { // AddTx add a transaction to the txpool. AddTx(tx *types.Transaction) error // DelTxs delete the transactions which in processing queue. // Once a block was committed, transaction contained in the block can be removed. DelTxs(txs []*types.Transaction) // GetTxs gets the transactions which in pending status. GetTxs() []*types.Transaction }
func NewTxPool ¶
func NewTxPool(config TxPoolConfig, eventCenter types.EventCenter) TxsPool
NewTxPool creates a new transaction pool to gather, sort and filter inbound transactions from the network and local.
Click to show internal directories.
Click to hide internal directories.