breez / breez-sdk-greenlight

MIT License
244 stars 43 forks source link

Bug: `list_refundables` keeps returning refunded swap while refund tx is pending in mempool #1116

Closed danielgranhao closed 3 weeks ago

danielgranhao commented 3 weeks ago

As the title describes, we've found that when refunding a failed swap, while the refund tx is in the mempool, list_refundables continues to return the swap as refundable.

I don't think it's related, but when we experienced this, we were refunding towards ourselves using a new swap address.

roeierez commented 3 weeks ago

@danielgranhao this is actually by design so the app can bump the fees and broadcast another refund in case the tx is stuck in the mempool for example. Do you see any issue with that?

danielgranhao commented 3 weeks ago

Thanks for the explanation, @roeierez. So, if we want to show only actionable items, we have to filter out swaps that have a pending refund tx. It's probably enough to check that there is something in SwapInfo.refund_tx_ids. If that's the case, that would cover our needs.