mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
fix typo in costs modifier (#850)
This commit is contained in:
parent
dbc95570cb
commit
c547f9c24b
@ -82,13 +82,13 @@ restrictions highly readable.
|
|||||||
// refunded, but only after the function body.
|
// refunded, but only after the function body.
|
||||||
// This is dangerous, because if the function
|
// This is dangerous, because if the function
|
||||||
// uses `return` explicitly, this will not be
|
// uses `return` explicitly, this will not be
|
||||||
// done!
|
// done! This behavior will be fixed in Version 0.4.0.
|
||||||
modifier costs(uint _amount) {
|
modifier costs(uint _amount) {
|
||||||
if (msg.value < _amount)
|
if (msg.value < _amount)
|
||||||
throw;
|
throw;
|
||||||
_
|
_
|
||||||
if (msg.value > _amount)
|
if (msg.value > _amount)
|
||||||
msg.sender.send(_amount - msg.value);
|
msg.sender.send(msg.value - _amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
function forceOwnerChange(address _newOwner)
|
function forceOwnerChange(address _newOwner)
|
||||||
@ -163,7 +163,9 @@ function finishes.
|
|||||||
the code in the transitionNext modifier
|
the code in the transitionNext modifier
|
||||||
can be skipped if the function itself uses
|
can be skipped if the function itself uses
|
||||||
return. If you want to do that, make sure
|
return. If you want to do that, make sure
|
||||||
to call nextStage manually from those functions.
|
to call nextStage manually from those functions.
|
||||||
|
With version 0.4.0 (unreleased), modifier code
|
||||||
|
will run even if the function explicitly returns.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user