Closed buhrmi closed 9 years ago
Ah, well... nevermind. I guess it is how it is.
Yes, what happens is that offers don't get updated with every transaction: the most likely case is that people are moving funds back and forth and we didn't want to induce unnecessary churn on the offers to avoid amplification attacks (or having to do things like charge higher fees per transaction depending on the number of pending offers). Reason we did this, is that even if the amount in the offers was kept completely up to date, there would still be no guarantee for anyone that they could claim the said amount entirely as other transactions may get in front of them.
The reserve is the mechanism for people to have an incentive to clean up stale offers.
Offers do get updated/deleted if somebody tries to claim them (so you can think of that as a lazy delete), so if somebody was selling 200 X but now only has 50 X, the offer will be deleted after selling 50 X or updated to the account balance after the offer is partially taken.
@MonsieurNicolas Thanks for explaining this. Sounds like a very solid compromise. :+1:
Assume address AAA has trustline for ZZZ/USD, 0 balance, 200 limit Assume address AAA has trustline for YYY/EURO, 200 balance, 200 limit Assume address AAA creates an offer. selling 200 YYY/EURO, buying 200 ZZZ/USD
Now, if one of these things happens, the offer still is in the system, but becomes impossible to fullfil:
Imho, both of these transactions issued by AAA should fail because they would invalidate an outstanding offer created by AAA.