chequebook: use modern transfer method

This commit is contained in:
Alex Beregszaszi 2017-11-04 14:32:45 -05:00
parent f9b88bac27
commit c9320fd1b7

View file

@ -33,10 +33,7 @@ contract chequebook is mortal {
if (diff <= this.balance) { if (diff <= this.balance) {
// update the cumulative amount before sending // update the cumulative amount before sending
sent[beneficiary] = amount; sent[beneficiary] = amount;
if (!beneficiary.send(diff)) { beneficiary.transfer(diff);
// Upon failure to execute send, revert everything
throw;
}
} else { } else {
// Upon failure, punish owner for writing a bounced cheque. // Upon failure, punish owner for writing a bounced cheque.
// owner.sendToDebtorsPrison(); // owner.sendToDebtorsPrison();