controller

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTransaction byte = iota
	TypeBlock
	TypeBlockHead
	TypeIPs
)

Variables

This section is empty.

Functions

func InitController

func InitController(pool *txpool.Pool) error

Types

type Controller

type Controller struct {
	Pool       *txpool.Pool
	Miner      *miner.Miner
	BlockChain *blockchain.Blockchain

	AdvertiseAddr string
	// contains filtered or unexported fields
}

func New

func New(pool *txpool.Pool, blockChain *blockchain.Blockchain, miner *miner.Miner, logger *zap.Logger, AdvertiseAddr string, initBits uint32) (*Controller, error)

func (*Controller) HandleBlockHeadMessage

func (c *Controller) HandleBlockHeadMessage(msg []byte) error

func (*Controller) HandleIPsMessage

func (c *Controller) HandleIPsMessage(msg []byte) error

func (*Controller) HandleTransactionMessage

func (c *Controller) HandleTransactionMessage(msg []byte) error

func (*Controller) RegisterHandleFunc

func (c *Controller) RegisterHandleFunc() func([]byte) error

Jump to

Keyboard shortcuts

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