Merge pull request #764 from Denton-L/make-safe

Throw if send() fails in example code
This commit is contained in:
chriseth 2016-08-01 12:43:21 +02:00 committed by GitHub
commit 267b32df83

View File

@ -545,7 +545,8 @@ shown in the following example:
Campaign c = campaigns[campaignID];
if (c.amount < c.fundingGoal)
return false;
c.beneficiary.send(c.amount);
if (!c.beneficiary.send(c.amount))
throw;
c.amount = 0;
return true;
}