reactors

package
v0.0.0-...-63f9e25 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func SetCfg

func SetCfg(c *config.Config)

func SetLogger

func SetLogger(l log.Logger)

Types

type KReactor

type KReactor struct {
	p2p.BaseReactor
	Name   string
	Prefix string
	ChId   byte
}

KReactor 处理大量的TX分发

func NewKReactor

func NewKReactor() *KReactor

NewKReactor

func (*KReactor) Broadcast

func (k *KReactor) Broadcast(msgBytes []byte)

广播所有的节点

func (*KReactor) GetChannels

func (k *KReactor) GetChannels() []*p2p.ChannelDescriptor

GetChannels implements Reactor. It returns the list of channels for this reactor.

func (*KReactor) Receive

func (k *KReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)

Receive implements Reactor. It adds any received transactions to the mempool.

func (*KReactor) SetLogger

func (k *KReactor) SetLogger(l log.Logger)

SetLogger sets the Logger on the reactor and the underlying Mempool.

Jump to

Keyboard shortcuts

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