Versions in this module Expand all Collapse all v0 v0.7.2 Apr 16, 2020 v0.7.1 Apr 9, 2020 Changes in this version + const SYNC_BLOCK_REQUEST_TIMEOUT + const SYNC_HEADER_REQUEST_TIMEOUT + const SYNC_MAX_BLOCK_CACHE_SIZE + const SYNC_MAX_ERROR_RESP_TIMES + const SYNC_MAX_FLIGHT_BLOCK_SIZE + const SYNC_MAX_FLIGHT_HEADER_SIZE + const SYNC_MAX_HEADER_FORWARD_SIZE + const SYNC_MAX_HEIGHT_OFFSET + const SYNC_NEXT_BLOCKS_HEIGHT + const SYNC_NEXT_BLOCK_TIMES + const SYNC_NODE_RECORD_SPEED_CNT + const SYNC_NODE_RECORD_TIME_CNT + const SYNC_NODE_SPEED_INIT + type BlockCache struct + func NewBlockCache() *BlockCache + type BlockInfo struct + type BlockSyncMgr struct + func NewBlockSyncMgr(server *P2PServer) *BlockSyncMgr + func (this *BlockSyncMgr) Close() + func (this *BlockSyncMgr) OnAddNode(nodeId uint64) + func (this *BlockSyncMgr) OnBlockReceive(fromID uint64, blockSize uint32, block *types.Block, merkleRoot common.Uint256) + func (this *BlockSyncMgr) OnDelNode(nodeId uint64) + func (this *BlockSyncMgr) OnHeaderReceive(fromID uint64, headers []*types.Header) + func (this *BlockSyncMgr) Start() + type NodeWeight struct + func NewNodeWeight(id uint64) *NodeWeight + func (this *NodeWeight) AddErrorRespCnt() + func (this *NodeWeight) AddTimeoutCnt() + func (this *NodeWeight) AppendNewReqtime() + func (this *NodeWeight) AppendNewSpeed(s float32) + func (this *NodeWeight) GetErrorRespCnt() int + func (this *NodeWeight) Weight() float32 + type NodeWeights []*NodeWeight + func (nws NodeWeights) Len() int + func (nws NodeWeights) Less(i, j int) bool + func (nws NodeWeights) Swap(i, j int) + type P2PServer struct + func NewServer() *P2PServer + func (this *P2PServer) GetConnectionCnt() uint32 + func (this *P2PServer) GetConnectionState() uint32 + func (this *P2PServer) GetID() uint64 + func (this *P2PServer) GetMaxPeerBlockHeight() uint64 + func (this *P2PServer) GetNeighborAddrs() []common.PeerAddr + func (this *P2PServer) GetNetWork() p2pnet.P2P + func (this *P2PServer) GetPID() *evtActor.PID + func (this *P2PServer) GetPort() uint16 + func (this *P2PServer) GetTime() int64 + func (this *P2PServer) GetVersion() uint32 + func (this *P2PServer) OnAddNode(id uint64) + func (this *P2PServer) OnBlockReceive(fromID uint64, blockSize uint32, block *types.Block, merkleRoot comm.Uint256) + func (this *P2PServer) OnDelNode(id uint64) + func (this *P2PServer) OnHeaderReceive(fromID uint64, headers []*types.Header) + func (this *P2PServer) Send(p *peer.Peer, msg msgtypes.Message, isConsensus bool) error + func (this *P2PServer) SetPID(pid *evtActor.PID) + func (this *P2PServer) Start() error + func (this *P2PServer) Stop() + func (this *P2PServer) WaitForPeersStart() + func (this *P2PServer) WaitForSyncBlkFinish() + func (this *P2PServer) Xmit(message interface{}) error + type ReconnectAddrs struct + RetryAddrs map[string]int + type SyncFlightInfo struct + Height uint32 + func NewSyncFlightInfo(height uint32, nodeId uint64) *SyncFlightInfo + func (this *SyncFlightInfo) GetFailedTimes(nodeId uint64) int + func (this *SyncFlightInfo) GetNodeId() uint64 + func (this *SyncFlightInfo) GetStartTime() time.Time + func (this *SyncFlightInfo) GetTotalFailedTimes() int + func (this *SyncFlightInfo) MarkFailedNode() + func (this *SyncFlightInfo) ResetStartTime() + func (this *SyncFlightInfo) SetNodeId(nodeId uint64)