aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-26 21:47:15 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-27 06:05:09 +0800
commit318e52c77d80a3a15256b1570b5a5bcef19368fe (patch)
tree86e335f05795e076b7c7ca62fe6a18c81249fff3
parent48a15ea19d74fb639b1b7e8a47b420f896857712 (diff)
downloaddexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.tar
dexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.tar.gz
dexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.tar.bz2
dexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.tar.lz
dexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.tar.xz
dexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.tar.zst
dexon-solidity-318e52c77d80a3a15256b1570b5a5bcef19368fe.zip
Avoid using .send in the examples
-rw-r--r--docs/solidity-by-example.rst9
1 files changed, 2 insertions, 7 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst
index 79eafd06..71d27192 100644
--- a/docs/solidity-by-example.rst
+++ b/docs/solidity-by-example.rst
@@ -491,7 +491,7 @@ high or low invalid bids.
}
/// Withdraw a bid that was overbid.
- function withdraw() returns (bool) {
+ function withdraw() {
uint amount = pendingReturns[msg.sender];
if (amount > 0) {
// It is important to set this to zero because the recipient
@@ -500,13 +500,8 @@ high or low invalid bids.
// conditions -> effects -> interaction).
pendingReturns[msg.sender] = 0;
- if (!msg.sender.send(amount)){
- // No need to call throw here, just reset the amount owing
- pendingReturns[msg.sender] = amount;
- return false;
- }
+ msg.sender.transfer(amount);
}
- return true;
}
/// End the auction and send the highest bid