The coin flip is done as a triggered ability on declaring the Djinn as an attacker.
2004-10-04 • wotc
If the Djinn attacks, but you lose the coin toss, then it is still considered to have attacked, and any other abilities that trigger on it attacking will resolve normally.
2004-10-04 • wotc
Any abilities which have already resolved before the coin flip are not undone. Any abilities that trigger when it attacks which have not already resolved will still resolve.
2004-10-04 • wotc