MostroP2P / mostro

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

BUG: Range sell orders request invoice for 0 sats if the buyer put an amount out of range, or leaves empty #306

Closed Catrya closed 5 months ago

Catrya commented 5 months ago

If a buyer takes a sales order with range and does not specify the amount he wants to buy, or put an amount out of range the order will go to status waiting-buyer-invoice. Mostro will publish in the event 38383:

"s",
        "waiting-buyer-invoice"
      ],
      [
        "amt",
        "0"
      ],
      [
        "fa",
        "0"
      ],

And the buyer will be asked to put an invoice for 0 sats:

 kind: Some(
                Sell,
            ),
            status: Some(
                WaitingBuyerInvoice,
            ),
            amount: 0,
            fiat_code: "CUP",
            min_amount: Some(
                100,
            ),
            max_amount: Some(
                700,
            ),
            fiat_amount: 0,

Instead, Mostro should send the message Amount requested is not correct, probably out of range and not go to status waiting-buyer-invoice

Note: this does not happen with range Buy orders. If the seller leave the amount empty, Mostro will send a messagge Amount requested is not correct, probably out of range