converted if() throw convention to require()/assert()/revert()
This commit is contained in:
committed by
Francisco Giordano
parent
f3867f8477
commit
18581f138f
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user