mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-27 02:02:53 +01:00
Send another UTXO if this is a neutrino backend. When sweeping anchors, there are two transactions created, `local_sweep_tx` for sweeping Alice's anchor on the local commitment, `remote_sweep_tx` for sweeping her anchor on the remote commitment. Whenever the force close transaction is published, Alice will always create these two transactions to sweep her anchor. On the other hand, when creating the sweep txes, the anchor itself is not able to cover the fee, so another wallet UTXO is needed. In our test case, there's a change output that can be used from the above funding process. And it's used by both sweep txes - when `lnd` happens to create the `remote_sweep_tx` first, it will receive an error since its parent tx, the remote commitment, is not known, hence freeing the change output to be used by `local_sweep_tx`. For neutrino client, however, it will consider the transaction which sweeps the remote anchor as an orphan tx, and it will neither send it to the mempool nor return an error to free the change output. Thus, if the change output is already used in `remote_sweep_tx`, we won't have UTXO to create `local_sweep_tx`.