This commit is contained in:
colm 2016-06-11 19:59:29 +00:00 committed by GitHub
commit b294442562

View file

@ -27,9 +27,11 @@ contract chequebook is mortal {
if(owner != ecrecover(hash, sig_v, sig_r, sig_s)) return; if(owner != ecrecover(hash, sig_v, sig_r, sig_s)) return;
// Attempt sending the difference between the cumulative amount on the cheque // Attempt sending the difference between the cumulative amount on the cheque
// and the cumulative amount on the last cashed cheque to beneficiary. // and the cumulative amount on the last cashed cheque to beneficiary.
if (amount - sent[beneficiary] >= this.balance) {
if (beneficiary.send(amount - sent[beneficiary])) { if (beneficiary.send(amount - sent[beneficiary])) {
// Upon success, update the cumulative amount. // Upon success, update the cumulative amount.
sent[beneficiary] = amount; sent[beneficiary] = amount;
}
} else { } else {
// Upon failure, punish owner for writing a bounced cheque. // Upon failure, punish owner for writing a bounced cheque.
// owner.sendToDebtorsPrison(); // owner.sendToDebtorsPrison();