From 318e52c77d80a3a15256b1570b5a5bcef19368fe Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 26 Jul 2017 14:47:15 +0100 Subject: Avoid using .send in the examples --- docs/solidity-by-example.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'docs/solidity-by-example.rst') 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 -- cgit