First of all, it should be stressed that Tawaf Al-Ifadah is one of the essential parts of Hajj without which one’s Hajj is incomplete. It is performed on the day of sacrifice, Dhul-Hijjah 10 and one should be in a state of purity when performing it.
As for a person who is not sure about his or her state of impurity, his or her Tawaf is valid.
In his explanation on this, Sheikh Muhammad Salih Al-Munajjid, a prominent scholar and author, states:
First, purity – greater and lesser – is a condition of Tawaf being valid according to the majority of scholars. If a person performs Tawaf when he is in a state of greater or lesser impurity (if he is junub or has broken his wudu’), his Tawaf is not valid and he has not exited ihram fully. Therefore, it is forbidden for him to have intercourse, and he has not exited from the state of ihram until he had performed Tawaf.
Second, if a person is not sure whether he is in a state of purity and is uncertain about that, then he does not have to perform ghusl, because the basic principle is that a person is in a state of purity.
Based on this, the Tawaf of a person who is in doubt regarding his state of impurity is valid as long as he is not certain that he had had an erotic dream and did not see any fluid emitted at climax. Therefore, there is no need to worry in this case.