dispatch

package
v0.0.0-...-5fb9e85 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Overview

Package dispatch

@author: xwc1125

Package dispatch

@author: xwc1125

Package dispatch

@author: xwc1125

Package dispatch

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApps

func NewApps(nodeKey protocol.NodeKey) protocol.Apps

func NewDefaultTxPool

func NewDefaultTxPool(txType types.TxType, config protocol.Config, app protocol.Application, appContext protocol.AppContext) (protocol.TxPool, error)

func NewTxPools

func NewTxPools(rootCtx context.Context, opts ...TxPoolsOption) (protocol.TxPools, error)

Types

type TxPools

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

func (*TxPools) Add

func (p *TxPools) Add(peerId *models.P2PID, tx models.Transaction) (err error)

func (*TxPools) Delete

func (p *TxPools) Delete(txType types.TxType, txs []models.Transaction, noErr bool) error

func (*TxPools) DeleteOne

func (p *TxPools) DeleteOne(tx models.Transaction, noErr bool) error

func (*TxPools) Fallback

func (p *TxPools) Fallback(txType types.TxType, txs []models.Transaction) error

func (*TxPools) FetchTxs

func (p *TxPools) FetchTxs(txsLimit uint64, headerTimestamp uint64) models.Transactions

func (*TxPools) Get

func (p *TxPools) Get(txType types.TxType, hash types.Hash) (models.Transaction, models.TxStatus)

func (*TxPools) GetTxs

func (p *TxPools) GetTxs(txsLimit uint64) map[types.TxType][]models.Transaction

func (*TxPools) Len

func (p *TxPools) Len() map[types.TxType]uint64

func (*TxPools) Register

func (p *TxPools) Register(txType types.TxType, txPool protocol.TxPool)

func (*TxPools) Start

func (p *TxPools) Start() (err error)

func (*TxPools) Stop

func (p *TxPools) Stop() (err error)

func (*TxPools) Subscribe

func (p *TxPools) Subscribe(ch chan []models.Transaction) event.Subscription

Subscribe 订阅

func (*TxPools) TxPool

func (p *TxPools) TxPool(txType types.TxType) (protocol.TxPool, error)

type TxPoolsOption

type TxPoolsOption func(f *TxPools) error

func WithApps

func WithApps(apps protocol.Apps) TxPoolsOption

func WithBlockReader

func WithBlockReader(blockReader protocol.BlockReader) TxPoolsOption

func WithBroadcaster

func WithBroadcaster(broadcaster protocol.Broadcaster) TxPoolsOption

func WithConfig

func WithConfig(config protocol.Config) TxPoolsOption

Jump to

Keyboard shortcuts

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