From 617daa1f004dba9960c0de57109d5b1554a9f599 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Mon, 11 Jul 2016 10:28:20 -0400 Subject: Fix withdrawal pattern documentation --- docs/common-patterns.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 0de692fc..e725e786 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -11,8 +11,8 @@ Withdrawal from Contracts ************************* The recommended method of sending funds after an effect -is with the withdrawal pattern. Although the most intuitive -aethod of sending Ether as a result of an effect is a +is using the withdrawal pattern. Although the most intuitive +method of sending Ether, as a result of an effect, is a direct ``send`` call, this is not recommended as it introduces a potential security risk. You may read more about this on the :ref:`security_considerations` page. @@ -28,7 +28,7 @@ an Ether storage contract. mapping (address => uint) pendingReturns; function sendEther(uint amount) { - if (amount < etherStore[msg.sender]) { + if (amount > etherStore[msg.sender]) { throw; } etherStore[msg.sender] -= amount; @@ -60,7 +60,7 @@ This is as opposed to the more intuitive sending pattern. mapping (address => uint) etherStore; function sendEther(uint amount) { - if (amount < etherStore[msg.sender]) { + if (amount > etherStore[msg.sender]) { throw; } etherStore[msg.sender] -= amount; -- cgit