File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
swarm/services/chequebook/contract Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ contract chequebook is mortal {
27
27
if (owner != ecrecover (hash, sig_v, sig_r, sig_s)) return ;
28
28
// Attempt sending the difference between the cumulative amount on the cheque
29
29
// and the cumulative amount on the last cashed cheque to beneficiary.
30
- if (beneficiary.send (amount - sent[beneficiary])) {
31
- // Upon success, update the cumulative amount.
32
- sent[beneficiary] = amount;
30
+ if (amount - sent[beneficiary] >= this .balance) {
31
+ if (beneficiary.send (amount - sent[beneficiary])) {
32
+ // Upon success, update the cumulative amount.
33
+ sent[beneficiary] = amount;
34
+ }
33
35
} else {
34
36
// Upon failure, punish owner for writing a bounced cheque.
35
37
// owner.sendToDebtorsPrison();
You can’t perform that action at this time.
0 commit comments