sync

package
v0.0.0-...-d9e9b57 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Chain       *chain.Blockchain
	TxMemPool   *mempool.TxPool
	Peer        *peer.Peer
	AddrManager *addr.AddrManager
	MaxPeers    int
}

Config is a configuration struct used to initialize a new SyncManager.

type SyncManager

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

func New

func New(config *Config) (*SyncManager, error)

New return a new SyncManager with sync config

func (*SyncManager) AddPeerState

func (manager *SyncManager) AddPeerState(remoteAddr string)

AddPeerState create new remote peer state if already exists, not cover it

func (*SyncManager) HandleMessage

func (manager *SyncManager) HandleMessage(msg protocol.Message)

func (*SyncManager) StartSync

func (manager *SyncManager) StartSync()

StartSync start loop sync handle

Jump to

Keyboard shortcuts

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