protocol

package
v0.6.4-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: ISC Imports: 25 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages the p2p protocol

func NewManager

func NewManager(cfg *config.Config, dag *blockdag.BlockDAG, netAdapter *netadapter.NetAdapter,
	addressManager *addressmanager.AddressManager, txPool *mempool.TxPool,
	connectionManager *connmanager.ConnectionManager) (*Manager, error)

NewManager creates a new instance of the p2p protocol manager

func (*Manager) AddBlock

func (m *Manager) AddBlock(block *util.Block, flags blockdag.BehaviorFlags) error

AddBlock adds the given block to the DAG and propagates it.

func (*Manager) AddTransaction

func (m *Manager) AddTransaction(tx *util.Tx) error

AddTransaction adds transaction to the mempool and propagates it.

func (*Manager) IBDPeer

func (m *Manager) IBDPeer() *peerpkg.Peer

IBDPeer returns the currently active IBD peer. Returns nil if we aren't currently in IBD

func (*Manager) Peers

func (m *Manager) Peers() []*peerpkg.Peer

Peers returns the currently active peers

func (*Manager) Start

func (m *Manager) Start() error

Start starts the p2p protocol

func (*Manager) Stop

func (m *Manager) Stop() error

Stop stops the p2p protocol

Jump to

Keyboard shortcuts

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