staticaddr: arbitrary loop-in amount

In this commit we add a new function SelectDeposits
to the loop-in manager. It coin-selects deposits that
meet an arbitrary swap amount provided by the client.
We have to ensure that the server creates the correct
change outputs for the htlc- and sweepless sweep
transactions.
This commit is contained in:
Slyghtning 2025-06-27 10:56:28 +02:00
parent 4931fb9ccd
commit 581761a12f
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
7 changed files with 529 additions and 46 deletions

View file

@ -338,6 +338,11 @@ type StaticAddressLoopInRequest struct {
// swap payment. If the timeout is reached the swap will be aborted and
// the client can retry the swap if desired with different parameters.
PaymentTimeoutSeconds uint32
// SelectedAmount is the amount that the user selected for the swap. If
// the user did not select an amount, the amount of the selected
// deposits is used.
SelectedAmount btcutil.Amount
}
// LoopInTerms are the server terms on which it executes loop in swaps.