Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Catrya
Copy link
Collaborator

@Catrya Catrya commented Sep 2, 2024

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.

@arkanoider
Copy link
Collaborator

@Catrya @grunch ,

i think this is correct, just don't know how lnp2p manage this. I mean now a range order cannot be taken from other people until it's completed ( with success or not ) . Is this correct or we want other users can take the same order while it's still active?

return Ok(());
}


Copy link
Collaborator

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?

Copy link
Collaborator Author

@Catrya Catrya Sep 3, 2024

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

Copy link
Member

@grunch grunch left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change check order when taking an order
3 participants