-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When taking an order, check the status first and then the quantity #351
Conversation
src/app/take_buy.rs
Outdated
return Ok(()); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this call below indeed is avoiding that a user can take another time the offer until it's completed ( successfully or not ). It could be good to me, but I don't know what is the behaviuor of lnp2p in this case, I mean a range order in lnp2p can have two pending orders simoultaneously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this call below indeed is avoiding that a user can take another time the offer until it's completed ( successfully or not ). It could be good to me, but I don't know what is the behaviuor of lnp2p in this case, I mean a range order in lnp2p can have two pending orders simoultaneously?
In lnp2pbot an order can only be taken in pending
status. If it has a range, until it is completed it is not published again so that someone can take what is left of the range. I suppose that is the expected behavior for Mostro as well, I don't know if @grunch wants to do it differently here
But what is happening now in Mostro is that if someone takes an order with a range but it is already in any other status that is not pending
because someone else is already taking it, or they are already taking it, if they put that they are going to take it with an amount outside the range, Mostro will respond OutOfRangeFiatAmount
, and when that person later puts an amount within the range, Mostro will tell them that it is NotAllowedByStatus
.
So what I propose is to save a step and have Mostro respond from the beginning that it cannot be taken NotAllowedByStatus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please solve the conflicts
If conflicts are over I think this could be merged @grunch , make sense imo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix #349
Now when someone takes an order Mostro will first check the status of the order and then if it has a range it will check the quantity that was requested to be taken is within the range and not the other way around.