mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-08 22:41:00 +02:00
sweep: update sweeper to use AuxSweeper to add extra change addr
In this commit, we start to use the AuxSweeper (if present) to obtain a new extra change addr we should add to the sweeping transaction. With this, we'll take the set of inputs and our change addr, and then maybe gain a new change addr to add to the sweep transaction. The extra change addr will be treated as an extra required tx out, shared across all the relevant inputs. This'll also be used in NeedWalletInput to make sure that we add an extra input if needed to be able to pay for the change addr.
This commit is contained in:
@ -50,6 +50,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/rpcperms"
|
||||
"github.com/lightningnetwork/lnd/signal"
|
||||
"github.com/lightningnetwork/lnd/sqldb"
|
||||
"github.com/lightningnetwork/lnd/sweep"
|
||||
"github.com/lightningnetwork/lnd/walletunlocker"
|
||||
"github.com/lightningnetwork/lnd/watchtower"
|
||||
"github.com/lightningnetwork/lnd/watchtower/wtclient"
|
||||
@ -188,6 +189,10 @@ type AuxComponents struct {
|
||||
// modify the way a coop-close transaction is constructed.
|
||||
AuxChanCloser fn.Option[chancloser.AuxChanCloser]
|
||||
|
||||
// AuxSweeper is an optional interface that can be used to modify the
|
||||
// way sweep transaction are generated.
|
||||
AuxSweeper fn.Option[sweep.AuxSweeper]
|
||||
|
||||
// AuxContractResolver is an optional interface that can be used to
|
||||
// modify the way contracts are resolved.
|
||||
AuxContractResolver fn.Option[lnwallet.AuxContractResolver]
|
||||
|
Reference in New Issue
Block a user