txpool

package
v0.0.0-...-e495fa0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2022 License: GPL-3.0, LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 GetTxPool

func GetTxPool() *TxPool

func NewTxPool

func NewTxPool(config config.TxPoolConfiguration, chainConfig *config.ChainConfig, blockChain blockChain) *TxPool

Create the transaction pool and start main process loop.

func (*TxPool) AddTx

func (pool *TxPool) AddTx(tx *types.Transaction) error

func (*TxPool) AddTxs

func (pool *TxPool) AddTxs(txs []*types.Transaction) error

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) DupTx

func (pool *TxPool) DupTx(tx *types.Transaction) error

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

func (pool *TxPool) JustPending(newblock *types.Block)

reset move package in block transactions from pending to onChain.

func (*TxPool) KnownTxAdd

func (pool *TxPool) KnownTxAdd(hash common.Hash)

func (*TxPool) Pended

func (pool *TxPool) Pended() (pending types.Transactions, err error)

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) Signer

func (pool *TxPool) Signer() types.Signer

func (*TxPool) Start

func (pool *TxPool) Start()

func (*TxPool) State

func (pool *TxPool) State() *state.ManagedState

State returns the virtual managed state of the transaction pool.

func (*TxPool) Stats

func (pool *TxPool) Stats() (int, int)

stats retrieves the current pool stats, namely the number of pending and the number of queued (non-executable) transactions.

func (*TxPool) Stop

func (pool *TxPool) Stop()

Stop the transaction pool.

func (*TxPool) SubscribeTxPreEvent

func (pool *TxPool) SubscribeTxPreEvent(ch chan<- bc.TxPreEvent) sub.Subscription

func (*TxPool) WorkEnded

func (pool *TxPool) WorkEnded(workid int64, blocknumber uint64, succeed bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL