tokenly / swapbot

Exchange tokens with an automated machine
3 stars 4 forks source link

Detect incoming transactions that never confirm #186

Open deweller opened 9 years ago

deweller commented 9 years ago

When a user sends a transaction to the bot, but that transaction is never confirmed, we need to detect this and send a message.

Here is the email that will be send (if someone left their email address):

Hi there! You recently tried to place an order with Swapbot and your deposit of {Amount} {Token user tried to pay with} was rejected by the bitcoin network!

Don't panic! That just means you still have your {Amount} {Token user tried to pay with}, it's safely locked in your account ready for you to try again. This can sometimes happen and has nothing at all to do with you, but it can also be caused by attempting to make a deposit with too small of a bitcoin miner fee.

Visit {Swapbots web address} to place your order again or email help@tokenly.com

deweller commented 9 years ago

The only reliable way to do this is to track the UTXOs for each transaction. Only when one of the UTXOs are spent in another transaction can we really be sure the transaction will never confirm.

This depends on tokenly/xchain#17