mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
Merge 2cb109bb8c into e2853948da
This commit is contained in:
commit
b294442562
1 changed files with 5 additions and 3 deletions
|
|
@ -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 (beneficiary.send(amount - sent[beneficiary])) {
|
if (amount - sent[beneficiary] >= this.balance) {
|
||||||
// Upon success, update the cumulative amount.
|
if (beneficiary.send(amount - sent[beneficiary])) {
|
||||||
sent[beneficiary] = amount;
|
// Upon success, update the cumulative 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();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue