txpool

package
v0.0.0-...-a173fca Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MODULENAME = "txpool"
)

Variables

View Source
var (
	ErrQueueFull  = errors.New("queue full")
	ErrTxExist    = errors.New("transaction exists")
	ErrTxPoolFull = errors.New("transaction pool full")
)

Functions

This section is empty.

Types

type TransactionPool

type TransactionPool struct {
	// contains filtered or unexported fields
}

TransactionPool ... 1 The transactions in the pool are sorted and sorted in two different queues according to whether or not the nonce is continuous 2 The sorted ones can be packed into blocks 3 The transactions in the pool are deleted according to the Nonce corresponding to the transactions of each address in the block

func NewTransactionPool

func NewTransactionPool(chainStore store.StoreInterface, journalPath string) *TransactionPool

NewTransactionPool Create a trading pool

func (*TransactionPool) AddTransaction

func (pool *TransactionPool) AddTransaction(tx *types.Transaction, isLocal bool) error

AddTransaction ransaction put in txpool

func (*TransactionPool) GetMiniPendingNonce

func (pool *TransactionPool) GetMiniPendingNonce(addr *crypto.CommonAddress) uint64

GetMiniPendingNonce Gets the smallest nonce in the Pending queue

func (*TransactionPool) GetPending

func (pool *TransactionPool) GetPending(GasLimit *big.Int) []*types.Transaction

GetPending The packaging process takes the transaction and packages it

func (*TransactionPool) GetQueue

func (pool *TransactionPool) GetQueue() []*types.Transaction

GetQueue Gets all transactions in the non-strictly sorted queue in the transaction pool

func (*TransactionPool) GetTransactionCount

func (pool *TransactionPool) GetTransactionCount(address *crypto.CommonAddress) uint64

GetTransactionCount Gets the total number of transactions, that is, the nonce corresponding to the address

func (*TransactionPool) GetTransactions

func (pool *TransactionPool) GetTransactions(addr *crypto.CommonAddress) []types.Transactions

GetTransactions gets all the trades in the current pool

func (*TransactionPool) GetTxInPool

func (pool *TransactionPool) GetTxInPool(hash string) (*types.Transaction, error)

GetTxInPool get transactions in the trading pool

func (*TransactionPool) NewTxFeed

func (pool *TransactionPool) NewTxFeed() *event.Feed

NewTxFeed new transaction feed in the trading pool

func (*TransactionPool) Start

func (pool *TransactionPool) Start(feed *event.Feed, tipRoot []byte)

Start start transaction pool

func (*TransactionPool) Stop

func (pool *TransactionPool) Stop()

Stop transaction pool work

Jump to

Keyboard shortcuts

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