Closed ok300 closed 1 week ago
Yes. Kind of related to this: https://github.com/SatoshiPortal/boltz-rust/issues/11
Although this is extremely rare, the library should handle such edge cases.
We should make fetch_utxos
return a Vec<(Outpoint, TxOut)>
rather than a single (Outpoint,Txout)
and SwapTx to have utxos
as a Vec
rather than a single utxo
Just noticed you have a PR for this too.
Nice! Reviewing it now.
For incoming chain swaps (BTC -> LBTC), in case of address re-use (e.g. user locks up funds via several txs to the swap lockup address), the refund will only consider the 1st utxo. This means it's not possible to refund any of the subsequent utxos. It's also not possible to claim them, as the claim is also triggered for the 1st utxo.
There are several variants of this:
In both cases, it would be useful if
BtcSwapTx::new_refund
would build a refund tx using all available utxos.