txpool

package
v0.0.0-...-77b6ffe Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTxDuplicate = errors.New("transaction duplicate")
	ErrPoolFull    = errors.New("tx_pool is full")
	ErrTxDiscard   = errors.New("old transaction is better, discard the new one")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxTxSize     uint64 // Max size of tx pool
	PriceBump     int    // Price bump to decide whether to replace tx or not
	BatchTimeout  time.Duration
	BatchCapacity int
}

type TxPool

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

func NewTxPool

func NewTxPool(config *common.Config, validator consensus.TxValidator, state *state.StateDB, useBatch bool, onlybroadcast bool) *TxPool

func (*TxPool) Add

func (tp *TxPool) Add(tx *types.Transaction) error

func (*TxPool) Drop

func (tp *TxPool) Drop(drops types.Transactions)

Drop removes transactions that have been processed from tx_pool

func (*TxPool) Error

func (tp *TxPool) Error(err error)

func (*TxPool) Pending

func (tp *TxPool) Pending() types.Transactions

Pending returns all nonce-asec-sorted and gasPrice-desec-sorted list of transactions for every address

func (*TxPool) Run

func (tp *TxPool) Run(id peer.ID, message *pb.Message) error

func (*TxPool) Start

func (tp *TxPool) Start()

func (*TxPool) Stop

func (tp *TxPool) Stop()

func (*TxPool) Type

func (tp *TxPool) Type() string

Jump to

Keyboard shortcuts

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