func (s *SyncManager) registerHandlers() (*p2p.ProtocolHandler, error) {
	handler, err := s.hostNode.RegisterProtocolHandler(beaconSyncProtocol, maxSyncPeers, minSyncPeers)
	if err != nil {
		return nil, err
	}

	err = handler.RegisterHandler("pb.GetBlocksMessage", s.onMessageGetBlocks)
	if err != nil {
		return nil, err
	}

	err = handler.RegisterHandler("pb.BeaconBlockMessage", s.onMessageBlock)
	if err != nil {
		return nil, err
	}

	err = handler.RegisterHandler("pb.MempoolMessage", s.onMessageMempool)
	if err != nil {
		return nil, err
	}

	err = handler.RegisterHandler("pb.GetMempoolMessage", s.onMessageGetMempool)
	if err != nil {
		return nil, err
	}

	err = handler.RegisterHandler("pb.BeaconVersionMessage", s.onMessageVersion)
	if err != nil {
		return nil, err
	}

	handler.Notify(s)

	return handler, nil
}
// registerHandlers registers handlers with the host node.
registerHandlers registers handlers with the host node.
// registerHandlers registers handlers with the host node .
func (s *SyncManager) registerHandlers() (*p2p.ProtocolHandler, error) {
	handler, err := s.hostNode.RegisterProtocolHandler(beaconSyncProtocol, maxSyncPeers, minSyncPeers)
	if err != nil {
		return nil, err
	}
	err = handler.RegisterHandler("pb.GetBlocksMessage", s.onMessageGetBlocks)
	if err != nil {
		return nil, err
	}
	err = handler.RegisterHandler("pb.BeaconBlockMessage", s.onMessageBlock)
	if err != nil {
		return nil, err
	}
	err = handler.RegisterHandler("pb.MempoolMessage", s.onMessageMempool)
	if err != nil {
		return nil, err
	}
	err = handler.RegisterHandler("pb.GetMempoolMessage", s.onMessageGetMempool)
	if err != nil {
		return nil, err
	}
	err = handler.RegisterHandler("pb.BeaconVersionMessage", s.onMessageVersion)
	if err != nil {
		return nil, err
	}
	handler.Notify(s)
	return handler, nil
}
func ( s * SyncManager ) registerHandlers ( ) ( * p2p . ProtocolHandler , error ) { handler , err := s . hostNode . RegisterProtocolHandler ( beaconSyncProtocol , maxSyncPeers , minSyncPeers ) if err != nil { return nil , err } err = handler . RegisterHandler ( " " , s . onMessageGetBlocks ) if err != nil { return nil , err } err = handler . RegisterHandler ( " " , s . onMessageBlock ) if err != nil { return nil , err } err = handler . RegisterHandler ( " " , s . onMessageMempool ) if err != nil { return nil , err } err = handler . RegisterHandler ( " " , s . onMessageGetMempool ) if err != nil { return nil , err } err = handler . RegisterHandler ( " " , s . onMessageVersion ) if err != nil { return nil , err } handler . Notify ( s ) return handler , nil }
registerHandlers registers handlers with the host node.
registerHandlers registers handlers with the host node .