Commit 30c0600a by Manuel Araoz

some security fixes

parent c543282f
......@@ -9,7 +9,10 @@ contract BadPushPayments {
if (msg.value < highestBid) throw;
if (highestBidder != 0) {
highestBidder.send(highestBid);
// return bid to previous winner
if (!highestBidder.send(highestBid)) {
throw;
}
}
highestBidder = msg.sender;
......
......@@ -14,7 +14,7 @@ contract GoodPullPayments {
highestBid = msg.value;
}
function withdrawRefund() external {
function withdrawBid() external {
uint refund = refunds[msg.sender];
refunds[msg.sender] = 0;
if (!msg.sender.send(refund)) {
......
contract PullPaymentCapable {
mapping(address => uint) refunds;
function asyncSend(address dest, uint amount) {
function asyncSend(address dest, uint amount) internal {
refunds[dest] += amount;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment