txpool

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxPool

type TxPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(config *order.Config, storage storage.Storage, packSize int, blockTick time.Duration) (*TxPool, chan *raftproto.Ready)

New txpool

func (*TxPool) AddPendingTx

func (tp *TxPool) AddPendingTx(tx *pb.Transaction) error

Add pending transaction into txpool

func (*TxPool) BatchDelete

func (tp *TxPool) BatchDelete(hashes []types.Hash)

batch delete txs

func (*TxPool) BatchStore

func (tp *TxPool) BatchStore(hashes []types.Hash)

batch store txs

func (*TxPool) Broadcast

func (tp *TxPool) Broadcast(tx *pb.Transaction) error

Broadcast the new transaction to other nodes

func (*TxPool) BuildReqLookUp

func (tp *TxPool) BuildReqLookUp()

Store the bloom filter

func (*TxPool) CheckExecute

func (tp *TxPool) CheckExecute(isLeader bool)

Check the txpool status, only leader node can run Execute()

func (*TxPool) FetchBlock

func (tp *TxPool) FetchBlock(height uint64) (*pb.Block, error)

Fetch tx by local txpool or network

func (*TxPool) FetchTx

func (tp *TxPool) FetchTx(hash types.Hash) *pb.Transaction

Fetch tx by local txpool or network

func (*TxPool) GetHeight

func (tp *TxPool) GetHeight() uint64

Get current block height

func (*TxPool) GetTx

func (tp *TxPool) GetTx(hash types.Hash, findByStore bool) (*pb.Transaction, bool)

Get the transaction by txpool or ledger

func (*TxPool) PoolSize

func (tp *TxPool) PoolSize() int

Current txpool's size

func (*TxPool) RemoveTxs

func (tp *TxPool) RemoveTxs(hashes []types.Hash, isLeader bool)

Remove stored transactions

func (*TxPool) UpdateHeight

func (tp *TxPool) UpdateHeight() uint64

Add the block height

Jump to

Keyboard shortcuts

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