mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Avoid using .send in the examples
This commit is contained in:
parent
48a15ea19d
commit
318e52c77d
@ -491,7 +491,7 @@ high or low invalid bids.
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Withdraw a bid that was overbid.
|
/// Withdraw a bid that was overbid.
|
||||||
function withdraw() returns (bool) {
|
function withdraw() {
|
||||||
uint amount = pendingReturns[msg.sender];
|
uint amount = pendingReturns[msg.sender];
|
||||||
if (amount > 0) {
|
if (amount > 0) {
|
||||||
// It is important to set this to zero because the recipient
|
// It is important to set this to zero because the recipient
|
||||||
@ -500,13 +500,8 @@ high or low invalid bids.
|
|||||||
// conditions -> effects -> interaction).
|
// conditions -> effects -> interaction).
|
||||||
pendingReturns[msg.sender] = 0;
|
pendingReturns[msg.sender] = 0;
|
||||||
|
|
||||||
if (!msg.sender.send(amount)){
|
msg.sender.transfer(amount);
|
||||||
// No need to call throw here, just reset the amount owing
|
|
||||||
pendingReturns[msg.sender] = amount;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// End the auction and send the highest bid
|
/// End the auction and send the highest bid
|
||||||
|
Loading…
Reference in New Issue
Block a user