Skip to content

Commit

Permalink
state change before transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
imshubhamsingh committed Feb 7, 2018
1 parent 1bf1a2a commit b0b34f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tutorial-18/Casino.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ contract Casino {
public {
// Has winnings to claim
require(_winnings[msg.sender] > 0);
msg.sender.transfer(_winnings[msg.sender]);
uint claimAmount = _winnings[msg.sender];
_winnings[msg.sender] = 0;
msg.sender.transfer(claimAmount);
}
}

0 comments on commit b0b34f4

Please sign in to comment.