From c547f9c24b5bd57840ddd5543ab6e5288ddc5563 Mon Sep 17 00:00:00 2001 From: gl367 Date: Tue, 16 Aug 2016 10:26:57 -0400 Subject: fix typo in costs modifier (#850) --- docs/common-patterns.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/common-patterns.rst') diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 422e2758..322be3ef 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -82,13 +82,13 @@ restrictions highly readable. // refunded, but only after the function body. // This is dangerous, because if the function // uses `return` explicitly, this will not be - // done! + // done! This behavior will be fixed in Version 0.4.0. modifier costs(uint _amount) { if (msg.value < _amount) throw; _ if (msg.value > _amount) - msg.sender.send(_amount - msg.value); + msg.sender.send(msg.value - _amount); } function forceOwnerChange(address _newOwner) @@ -163,7 +163,9 @@ function finishes. the code in the transitionNext modifier can be skipped if the function itself uses 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. :: -- cgit v1.2.3