protocol

package
v0.10.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: ISC Imports: 23 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, domain domain.Domain, netAdapter *netadapter.NetAdapter, addressManager *addressmanager.AddressManager,
	connectionManager *connmanager.ConnectionManager) (*Manager, error)

NewManager creates a new instance of the p2p protocol manager

func (*Manager) AddBlock

func (m *Manager) AddBlock(block *externalapi.DomainBlock) error

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

func (*Manager) AddTransaction

func (m *Manager) AddTransaction(tx *externalapi.DomainTransaction) error

AddTransaction adds transaction to the mempool and propagates it.

func (*Manager) Close added in v0.10.0

func (m *Manager) Close()

Close closes the protocol manager and waits until all p2p flows finish.

func (*Manager) IBDPeer

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

IBDPeer returns the current IBD peer or null if the node is not in IBD

func (*Manager) IsIBDRunning

func (m *Manager) IsIBDRunning() bool

IsIBDRunning returns true if IBD is currently marked as running

func (*Manager) Peers

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

Peers returns the currently active peers

func (*Manager) SetOnBlockAddedToDAGHandler

func (m *Manager) SetOnBlockAddedToDAGHandler(onBlockAddedToDAGHandler flowcontext.OnBlockAddedToDAGHandler)

SetOnBlockAddedToDAGHandler sets the onBlockAddedToDAG handler

func (*Manager) SetOnPruningPointUTXOSetOverrideHandler added in v0.8.10

func (m *Manager) SetOnPruningPointUTXOSetOverrideHandler(onPruningPointUTXOSetOverrideHandler flowcontext.OnPruningPointUTXOSetOverrideHandler)

SetOnPruningPointUTXOSetOverrideHandler sets the OnPruningPointUTXOSetOverride handler

func (*Manager) SetOnTransactionAddedToMempoolHandler

func (m *Manager) SetOnTransactionAddedToMempoolHandler(onTransactionAddedToMempoolHandler flowcontext.OnTransactionAddedToMempoolHandler)

SetOnTransactionAddedToMempoolHandler sets the onTransactionAddedToMempool handler

func (*Manager) ShouldMine

func (m *Manager) ShouldMine() (bool, error)

ShouldMine returns whether it's ok to use block template from this node for mining purposes.

Directories

Path Synopsis
flows

Jump to

Keyboard shortcuts

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