From 1f19b938366364acb7b628dbefa9af9249bf936d Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 1 Jun 2016 13:59:16 -0400 Subject: Copied warning message from cherry-picked commit --- docs/units-and-global-variables.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst index aa3551bf..ee9d60d6 100644 --- a/docs/units-and-global-variables.rst +++ b/docs/units-and-global-variables.rst @@ -124,9 +124,10 @@ Address Related For more information, see the section on :ref:`address`. .. warning:: - Since it is possible for calls to ``send`` to fail, such as - if there are insufficient funds, it is good practice to - check the return value whenever calling ``send``. + There are some dangers in using ``send``: The transfer fails if the call stack depth is at 1023 + (this can always be forced by the caller) and it also fails if the recipient runs out of gas. So in order + to make safe Ether transfers, always check the return value of ``send`` or even better: + Use a pattern where the recipient withdraws the money. .. index:: this, selfdestruct -- cgit