From 22ee2dedf91848d9fd98e19da8ee9829447f4676 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 24 May 2016 20:47:05 +0200 Subject: [PATCH] withdraw what you can --- SampleOffer.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SampleOffer.sol b/SampleOffer.sol index 73b48bf..dcab778 100644 --- a/SampleOffer.sol +++ b/SampleOffer.sol @@ -95,6 +95,9 @@ contract SampleOffer { if (msg.sender != contractor) throw; uint amount = (now - dateOfSignature + 1 days) / (1 days) * dailyWithdrawLimit - paidOut; + if (amount > this.balance) { + amount = this.balance; + } if (contractor.send(amount)) paidOut += amount; }