The question's place is meant for question only. OP should not add his or her answer there just to tell that this question is solved!
Instead, he/she should ask question and wait for what other user's can provide him with. Then if he donot get enough attention then he should provide some bounty to attract other users to the question. If he gets an answer now, Good!
If he doesn't get answer and fixes the thing himself. Then he has the option to answer his own question and so he should. He should just answer his question and mark it as answer.
This way it would be better for the new readers about what the condition is. They would
Read the question and the problem. If that matches their problem then go a few scrolls below and
Read the answer that solved the problem.
Easy and simple isn't it? Why does he need to edit the question and include the answer there?
I think it is fair to just ask a question, and if there is a need to answer, then he should just write it at the appropriate place.
And what you did is fair. You just placed it to the place where it belongs to, you should include OP's name and condition of the post alongwith the answer.
Stack Overflow asks users to not COPY PASTE text but to write their own answer. So if you wanted to answer it as a full-credit-to-yourself then you must have written the text in your own words atleast. But hey, your post is OK!