diff options
Diffstat (limited to 'test/contracts/AuctionRegistrar.cpp')
-rw-r--r-- | test/contracts/AuctionRegistrar.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index f94cc935..9aa47189 100644 --- a/test/contracts/AuctionRegistrar.cpp +++ b/test/contracts/AuctionRegistrar.cpp @@ -124,13 +124,19 @@ contract GlobalRegistrar is Registrar, AuctionSystem { function onAuctionEnd(string _name) internal { var auction = m_auctions[_name]; var record = m_toRecord[_name]; - if (record.owner != 0) - record.owner.send(auction.sumOfBids - auction.highestBid / 100); - else - auction.highestBidder.send(auction.highestBid - auction.secondHighestBid); + var previousOwner = record.owner; record.renewalDate = now + c_renewalInterval; record.owner = auction.highestBidder; Changed(_name); + if (previousOwner != 0) { + if (!record.owner.send(auction.sumOfBids - auction.highestBid / 100)) + throw; + } + else + { + if (!auction.highestBidder.send(auction.highestBid - auction.secondHighestBid)) + throw; + } } function reserve(string _name) external { |