code: func (sm *SyncManager) resetHeaderState(newestHash *chainhash.Hash, newestHeight int32) {
  	sm.headersFirstMode = false
  	sm.headerList.Init()
  	sm.startHeader = nil
  
  	// When there is a next checkpoint, add an entry for the latest known
  	// block into the header pool.  This allows the next downloaded header
  	// to prove it links to the chain properly.
  	if sm.nextCheckpoint != nil {
  		node := headerNode{height: newestHeight, hash: newestHash}
  		sm.headerList.PushBack(&node)
  	}
  }
docs: // resetHeaderState sets the headers-first mode state to values appropriate for
  // syncing from a new peer.