the condition  doesn't seem right to me: if you sent a remote prepare, surely you have to send a remote rollback as well, or?
From the condition written there seems like a rollback is when the prepare has NOT been sent...