MostroP2P / mostro

Lightning Network peer-to-peer exchange platform on Nostr
https://mostro.network
MIT License
191 stars 32 forks source link

BUG: a SALE order in status waiting-buyer-invoice can be taken multiple times #304

Closed Catrya closed 5 months ago

Catrya commented 5 months ago

If a buyer takes a sales order, when it is in status waiting-buyer-invoice before he send the invoice, any other buyer can take it and it will be taken away from the first one, and another event 38383 will be published with this order in status waiting-buyer-invoice for the new taker. If the first one tries to send the invoice mostro sends a messagge: Not allowed. If someone else takes it while it is in status waiting-buyer-invoice from the 2nd taker, it will be taken away from the previous 2 users... Even the first user can take it multiple times and each time a new 38383 event will be published for the order.

Note: With BUY orders the bug does not occur

Catrya commented 5 months ago

That error also occurs in range sales orders, but in addition in those cases there is another error: if a buyer takes a range sales order and puts an amount, and before sending the invoice, another buyer takes it but puts any other amount, Mostro will ask the second buyer to put an invoice for the amount of sats that the 1st user put, although the fiat amount is correctly shown in event 38383. If another buyer leaves the amount empty, mostro will take it as the amount of fiat and sats of the 1st user. I do not put it as another issue because when the #304 will fixed this other error will be avoided. Captura desde 2024-06-21 18-13-38

Captura desde 2024-06-21 18-14-31