I had heart failure 2 years ago I am getting breathless and my leg muscles hurt after I have been walking. Is my heart deteriating?

Not enough info. That is insufficient information to answer a complicated question. To determine that, a physician would need to examine you, determine what type of heart failure you had, what was the cause, what medications are you taking, and what other signs and symptoms you might have. See your physician.