diff options
-rw-r--r-- | solidity.html.markdown | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/solidity.html.markdown b/solidity.html.markdown index 6409828a..79debed6 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -49,7 +49,10 @@ contract AcmeBank { function withdraw(uint withdrawAmount) returns (uint remainingBalance) { if(balances[msg.sender] >= withdrawAmount) { balances[msg.sender] -= withdrawAmount; - balances[msg.sender].send(withdrawAmount); + + if (!balances[msg.sender].send(withdrawAmount)) { + balances[msg.sender] += withdrawAmount; + } return balances[msg.sender]; } |