Skip to content

Commit

Permalink
staticaddr: manage deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Mar 4, 2024
1 parent 46150c1 commit 2b1456b
Show file tree
Hide file tree
Showing 2 changed files with 402 additions and 19 deletions.
11 changes: 10 additions & 1 deletion loopd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
Store: store,
WalletKit: d.lnd.WalletKit,
ChainParams: d.lnd.ChainParams,
ChainNotifier: d.lnd.ChainNotifier,
Signer: d.lnd.Signer,
}
staticAddressManager := staticaddr.NewAddressManager(cfg)

Expand Down Expand Up @@ -666,8 +668,15 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
go func() {
defer d.wg.Done()

// Lnd's GetInfo call supplies us with the current block height.
info, err := d.lnd.Client.GetInfo(d.mainCtx)
if err != nil {
d.internalErrChan <- err
return
}

log.Info("Starting static address manager...")
err = staticAddressManager.Run(d.mainCtx)
err = staticAddressManager.Run(d.mainCtx, info.BlockHeight)
if err != nil && !errors.Is(context.Canceled, err) {
d.internalErrChan <- err
}
Expand Down
Loading

0 comments on commit 2b1456b

Please sign in to comment.