Documentation ¶
Index ¶
- Variables
- type TxPool
- func (pool *TxPool) AddTx(tx *types.Transaction) error
- func (pool *TxPool) AddTxs(txs []*types.Transaction) error
- func (pool *TxPool) Content() (pending, queue types.Transactions)
- func (pool *TxPool) DealTxRoutine(fullCh, verifyCh chan *types.Transaction)
- func (pool *TxPool) DupTx(tx *types.Transaction) error
- func (pool *TxPool) FitOnChain()
- func (pool *TxPool) GetTxByHash(hash common.Hash) *types.Transaction
- func (pool *TxPool) JustPending(newblock *types.Block)
- func (pool *TxPool) KnownTxAdd(hash common.Hash)
- func (pool *TxPool) Pended() (pending types.Transactions, err error)
- func (pool *TxPool) Pending(workid int64, maxtxs int) (pending types.Transactions)
- func (pool *TxPool) Signer() types.Signer
- func (pool *TxPool) Start()
- func (pool *TxPool) State() *state.ManagedState
- func (pool *TxPool) Stats() (int, int)
- func (pool *TxPool) Stop()
- func (pool *TxPool) SubscribeTxPreEvent(ch chan<- bc.TxPreEvent) sub.Subscription
- func (pool *TxPool) WorkEnded(workid int64, blocknumber uint64, succeed bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidSender is returned if the transaction contains an invalid signature. ErrInvalidSender = errors.New("invalid sender") // ErrNonceTooLow is returned if the nonce of a transaction is lower than the // one present in the local chain. ErrNonceTooLow = errors.New("nonce too low") // ErrUnderpriced is returned if a transaction's gas price is below the minimum // configured for the transaction pool. ErrUnderpriced = errors.New("transaction underpriced") // ErrReplaceUnderpriced is returned if a transaction is attempted to be replaced // with a different one without the required price bump. ErrReplaceUnderpriced = errors.New("replacement transaction underpriced") // ErrInsufficientFunds is returned if the total cost of executing a transaction // is higher than the balance of the user's account. ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") // ErrIntrinsicGas is returned if the transaction is specified to use less gas // than required to start the invocation. ErrIntrinsicGas = errors.New("intrinsic gas too low") // ErrGasLimit is returned if a transaction's requested gas limit exceeds the // maximum allowance of the current block. ErrGasLimit = errors.New("exceeds block gas limit") // ErrNegativeValue is a sanity error to ensure noone is able to specify a // transaction with a negative value. ErrNegativeValue = errors.New("negative value") // ErrOversizedData is returned if the input data of a transaction is greater // than some meaningful limit a user might use. This is not a consensus error // making the transaction invalid, rather a DOS protection. ErrOversizedData = errors.New("oversized data") // ErrTxPoolFull is returned if the pool is full. ErrTxPoolFull = errors.New("txpool full") //AsynSinger ErrAsynError = errors.New("ErrAsynError") )
View Source
var INSTANCE = atomic.Value{}
View Source
var STOPPED = atomic.Value{}
Functions ¶
This section is empty.
Types ¶
type TxPool ¶
type TxPool struct {
// contains filtered or unexported fields
}
func NewTxPool ¶
func NewTxPool(config config.TxPoolConfiguration, chainConfig *config.ChainConfig, blockChain blockChain) *TxPool
Create the transaction pool and start main process loop.
func (*TxPool) Content ¶
func (pool *TxPool) Content() (pending, queue types.Transactions)
func (*TxPool) DealTxRoutine ¶
func (pool *TxPool) DealTxRoutine(fullCh, verifyCh chan *types.Transaction)
func (*TxPool) FitOnChain ¶
func (pool *TxPool) FitOnChain()
func (*TxPool) GetTxByHash ¶
func (pool *TxPool) GetTxByHash(hash common.Hash) *types.Transaction
Get returns a transaction if it is contained in the pool and nil otherwise.
func (*TxPool) JustPending ¶
reset move package in block transactions from pending to onChain.
func (*TxPool) KnownTxAdd ¶
func (*TxPool) Pending ¶
func (pool *TxPool) Pending(workid int64, maxtxs int) (pending types.Transactions)
Pending retrieves all currently processable transactions, groupped by origin account and sorted by nonce. The returned transaction set is a copy and can be freely modified by calling code.
func (*TxPool) State ¶
func (pool *TxPool) State() *state.ManagedState
State returns the virtual managed state of the transaction pool.
func (*TxPool) Stats ¶
stats retrieves the current pool stats, namely the number of pending and the number of queued (non-executable) transactions.
func (*TxPool) SubscribeTxPreEvent ¶
func (pool *TxPool) SubscribeTxPreEvent(ch chan<- bc.TxPreEvent) sub.Subscription
Click to show internal directories.
Click to hide internal directories.