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`.
This commit adds the missing check for anchor sweep in test
`revoked_uncooperative_close_retribution_altruist_watchtower`, also
change the mempool check a bit so it's easier to track.
Now that we have patched the btcwallet version to the one that includes
the fix, we can adjust the rescan test to show the correct and expected
behavior.
In this commit we add a test that demonstrates the problem of ghost
UTXOs lingering in the wallet after a re-scan, even if they were spent.
NOTE: This test shows the incorrect behavior and will be adjusted in a
follow-up commit to show the correct behavior after patching the
btcwallet version.