Mortgage-rate optimism hits the highest level in 2 years