Return a bool to indicate whether PullPaymentBid.bid() is successful.

pull/19/head
adklempner 9 years ago
parent c365573413
commit fa828f25ab
  1. 9
      contracts/examples/PullPaymentBid.sol

@ -3,14 +3,15 @@ import '../PullPaymentCapable.sol';
contract PullPaymentBid is PullPaymentCapable { contract PullPaymentBid is PullPaymentCapable {
address public highestBidder; address public highestBidder;
uint public highestBid; uint public highestBid;
function bid() external { function bid() external returns (bool) {
if (msg.value <= highestBid) throw; if (msg.value <= highestBid) return false;
if (highestBidder != 0) { if (highestBidder != 0) {
asyncSend(highestBidder, highestBid); asyncSend(highestBidder, highestBid);
} }
highestBidder = msg.sender; highestBidder = msg.sender;
highestBid = msg.value; highestBid = msg.value;
return true;
} }
} }

Loading…
Cancel
Save