Let's say I have the following in my smart contract:
string passwordHash; uint money; function checkPassword(string cleanPassword, string newPasswordHash)[...]
When running the function checkPassword, I run it with the clean password. The clean password is then checked as sha256 with the passwordHash and if it's correct, the sender (normally me) gets the funds. But now following problem:
What if someone spectates my address, runs a transaction with more gas and gets "selected" before me: Is there a way to prevent someone "stealing the password from my transaction"? Is the only way to me run with more than enough gas?