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
// modify the way contracts are resolved.
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

View File

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