From 2db3756195616c04556cb7dbb693dbe2e2035c28 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Thu, 15 Feb 2024 15:27:33 +0100 Subject: [PATCH] staticaddr: feed manager with initial block height --- loopd/daemon.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/loopd/daemon.go b/loopd/daemon.go index d0b3fe99a6..d7b69708a5 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -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) @@ -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 }