protocols

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsensusHandle

func ConsensusHandle(ctx *p2p.Context, consensus *msgTypes.Consensus)

ConsensusHandle handles the consensus message from peer

func DataReqHandle

func DataReqHandle(ctx *p2p.Context, dataReq *msgTypes.DataReq)

DataReqHandle handles the data req(block/Transaction) from peer

func GetHeadersFromHash

func GetHeadersFromHash(startHash common.Uint256, stopHash common.Uint256) ([]*types.RawHeader, error)

get blk hdrs from starthash to stophash

func HeadersReqHandle

func HeadersReqHandle(ctx *p2p.Context, headersReq *msgTypes.HeadersReq)

HeaderReqHandle handles the header sync req from peer

func InvHandle

func InvHandle(ctx *p2p.Context, inv *msgTypes.Inv)

InvHandle handles the inventory message(block, transaction and consensus) from peer.

func TransactionHandle

func TransactionHandle(ctx *p2p.Context, trn *msgTypes.Trn)

TransactionHandle handles the transaction message from peer

Types

type MsgHandler

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

func NewMsgHandler

func NewMsgHandler(acct *account.Account, staticReserveFilter p2p.AddressFilter, ld *ledger.Ledger, logger msgCommon.Logger) *MsgHandler

func (*MsgHandler) GetMaskAddrFilter

func (self *MsgHandler) GetMaskAddrFilter() p2p.AddressFilter

func (*MsgHandler) GetReservedAddrFilter

func (self *MsgHandler) GetReservedAddrFilter(staticFilterEnabled bool) p2p.AddressFilter

func (*MsgHandler) GetSubnetMembersInfo

func (self *MsgHandler) GetSubnetMembersInfo() []msgCommon.SubnetMemberInfo

func (*MsgHandler) HandlePeerMessage

func (self *MsgHandler) HandlePeerMessage(ctx *p2p.Context, msg msgTypes.Message)

func (*MsgHandler) HandleSystemMessage

func (self *MsgHandler) HandleSystemMessage(net p2p.P2P, msg p2p.SystemMessage)

func (*MsgHandler) ReconnectService

func (mh *MsgHandler) ReconnectService() *reconnect.ReconnectService

Directories

Path Synopsis
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.

Jump to

Keyboard shortcuts

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