lnwallet: propagate API change for AddrWithKey + pass in AuxSweeper

This commit is contained in:
Olaoluwa Osuntokun 2024-06-07 20:57:09 -07:00
parent 207ff3f611
commit 0027da8732
2 changed files with 10 additions and 5 deletions

View File

@ -191,6 +191,10 @@ type AuxComponents struct {
// AuxContractResolver is an optional interface that can be used to // AuxContractResolver is an optional interface that can be used to
// modify the way contracts are resolved. // modify the way contracts are resolved.
AuxContractResolver fn.Option[lnwallet.AuxContractResolver] AuxContractResolver fn.Option[lnwallet.AuxContractResolver]
// AuxSweeper is an optional interface that can be used to modify the
// way sweep transaction are generated.
AuxSweeper fn.Option[lnwallet.AuxContractResolver]
} }
// DefaultWalletImpl is the default implementation of our normal, btcwallet // DefaultWalletImpl is the default implementation of our normal, btcwallet

View File

@ -522,7 +522,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
dbs.DecayedLogDB, cc.ChainNotifier, dbs.DecayedLogDB, cc.ChainNotifier,
) )
sphinxRouter := sphinx.NewRouter( sphinxRouter := sphinx.NewRouter(
nodeKeyECDH, cfg.ActiveNetParams.Params, replayLog, nodeKeyECDH, netParams, replayLog,
) )
writeBufferPool := pool.NewWriteBuffer( writeBufferPool := pool.NewWriteBuffer(
@ -1101,8 +1101,10 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
}) })
s.sweeper = sweep.New(&sweep.UtxoSweeperConfig{ s.sweeper = sweep.New(&sweep.UtxoSweeperConfig{
FeeEstimator: cc.FeeEstimator, FeeEstimator: cc.FeeEstimator,
GenSweepScript: newSweepPkScriptGen(cc.Wallet, s.cfg.ActiveNetParams.Params), GenSweepScript: newSweepPkScriptGen(
cc.Wallet, s.cfg.ActiveNetParams.Params,
),
Signer: cc.Wallet.Cfg.Signer, Signer: cc.Wallet.Cfg.Signer,
Wallet: newSweeperWallet(cc.Wallet), Wallet: newSweeperWallet(cc.Wallet),
Mempool: cc.MempoolNotifier, Mempool: cc.MempoolNotifier,
@ -1625,8 +1627,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
br, err := lnwallet.NewBreachRetribution( br, err := lnwallet.NewBreachRetribution(
channel, commitHeight, 0, nil, channel, commitHeight, 0, nil,
implCfg.AuxLeafStore, implCfg.AuxLeafStore, implCfg.AuxSweeper,
implCfg.AuxContractResolver,
) )
if err != nil { if err != nil {
return nil, 0, err return nil, 0, err