lnp2pBot/bot

Timer for BTC buyer(maker) should restart after seller(taker) has sent money to invoice

knocte opened this issue · 1 comments

knocte commented

Describe the bug
If the timeout for the BTC seller(taker of the order) is almost depleted, but he finally makes the payment, then the buyer doesn't have time to react. To fix this, there should be a new timer starting at the moment the money has been sent to the escrow.

To Reproduce
Steps to reproduce the behavior:

  1. Have a BTC buyer post an order, using for example EUR.
  2. Seller takes the order, a timer starts to count seconds for the seller to send sats to the escrow. (How much does this timer run for? not sure, let's say 10minutes).
  3. Wait 9:30 minutes until the timer is almost depleted.
  4. Seller sends money to escrow.
  5. Bot replies "Now I need the buyer to send an invoice so I can send satoshis to his/her wallet. I will put you both in touch as soon as the buyer sends the invoice. Wait a bit. The collateral will be returned to you if the buyer does not cooperate."

Current results
30 seconds later, as the buyer didn't have time to react, the bot answers "Buyer has not sent me the invoice to receive the sats for your order ID: foobarbaz, your sats were sent back to you"

Expected behavior
A new timer (of 10 minutes too?) should start after the escrow invoice is paid, to give time to the buyer to react.

grunch commented

I'm sorry for the delay responding this, this is a great bug report, thank you very much, this fix will be merged and be available in the next bot version 🥳