code: func New(mode SyncMode, checkpoint uint64, stateDb ethdb.Database, mux *event.TypeMux, chain BlockChain, lightchain LightChain, dropPeer peerDropFn) *Downloader {
  	if lightchain == nil {
  		lightchain = chain
  	}
  	dl := &Downloader{
  		mode:           mode,
  		stateDB:        stateDb,
  		mux:            mux,
  		checkpoint:     checkpoint,
  		queue:          newQueue(),
  		peers:          newPeerSet(),
  		rttEstimate:    uint64(rttMaxEstimate),
  		rttConfidence:  uint64(1000000),
  		blockchain:     chain,
  		lightchain:     lightchain,
  		dropPeer:       dropPeer,
  		headerCh:       make(chan dataPack, 1),
  		bodyCh:         make(chan dataPack, 1),
  		receiptCh:      make(chan dataPack, 1),
  		bodyWakeCh:     make(chan bool, 1),
  		receiptWakeCh:  make(chan bool, 1),
  		headerProcCh:   make(chan []*types.Header, 1),
  		quitCh:         make(chan struct{}),
  		stateCh:        make(chan dataPack),
  		stateSyncStart: make(chan *stateSync),
  		syncStatsState: stateSyncStats{
  			processed: rawdb.ReadFastTrieProgress(stateDb),
  		},
  		trackStateReq: make(chan *stateReq),
  	}
  	go dl.qosTuner()
  	go dl.stateFetcher()
  	return dl
  }
docs: // New creates a new downloader to fetch hashes and blocks from remote peers.