Documentation ¶
Index ¶
- type Manager
- func (m *Manager) AddBlock(block *externalapi.DomainBlock) error
- func (m *Manager) AddTransaction(tx *externalapi.DomainTransaction, allowOrphan bool) error
- func (m *Manager) Close()
- func (m *Manager) IBDPeer() *peerpkg.Peer
- func (m *Manager) IsIBDRunning() bool
- func (m *Manager) Peers() []*peerpkg.Peer
- func (m *Manager) SetOnBlockAddedToDAGHandler(onBlockAddedToDAGHandler flowcontext.OnBlockAddedToDAGHandler)
- func (m *Manager) SetOnPruningPointUTXOSetOverrideHandler(...)
- func (m *Manager) SetOnTransactionAddedToMempoolHandler(...)
- func (m *Manager) ShouldMine() (bool, error)
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, allowOrphan bool) 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) IsIBDRunning ¶
IsIBDRunning returns true if IBD is currently marked as running
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 ¶
ShouldMine returns whether it's ok to use block template from this node for mining purposes.