converted if() throw convention to require()/assert()/revert()

This commit is contained in:
Peter Murray
2017-07-09 13:57:43 -04:00
committed by Francisco Giordano
parent f3867f8477
commit 18581f138f
17 changed files with 87 additions and 132 deletions

View File

@ -32,19 +32,12 @@ contract PullPayment {
address payee = msg.sender;
uint256 payment = payments[payee];
if (payment == 0) {
throw;
}
if (this.balance < payment) {
throw;
}
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
if (!payee.send(payment)) {
throw;
}
assert(payee.send(payment));
}
}