staticaddr: log errors in manager.Run

This commit is contained in:
Slyghtning 2025-08-26 09:23:20 +02:00
parent 70cf2d828f
commit 0ee9a617e6
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
3 changed files with 15 additions and 3 deletions

View file

@ -106,12 +106,16 @@ func NewManager(cfg *ManagerConfig) *Manager {
func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
newBlockChan, newBlockErrChan, err := m.cfg.ChainNotifier.RegisterBlockEpochNtfn(ctx) //nolint:lll
if err != nil {
log.Errorf("unable to register block epoch notifier: %v", err)
return err
}
// Recover previous deposits and static address parameters from the DB.
err = m.recoverDeposits(ctx)
if err != nil {
log.Errorf("unable to recover deposits: %v", err)
return err
}

View file

@ -152,6 +152,9 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
registerBlockNtfn := m.cfg.ChainNotifier.RegisterBlockEpochNtfn
newBlockChan, newBlockErrChan, err := registerBlockNtfn(ctx)
if err != nil {
log.Errorf("unable to register for block notifications: %v",
err)
return err
}
@ -159,14 +162,14 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
// that are not yet completed.
err = m.recoverLoopIns(ctx)
if err != nil {
log.Errorf("unable to recover loop-ins: %v", err)
return err
}
// Register for notifications of loop-in sweep requests.
sweepReqs := m.cfg.NotificationManager.
SubscribeStaticLoopInSweepRequests(
ctx,
)
SubscribeStaticLoopInSweepRequests(ctx)
// Communicate to the caller that the address manager has completed its
// initialization.

View file

@ -152,11 +152,16 @@ func (m *Manager) Run(ctx context.Context, initChan chan struct{}) error {
m.cfg.ChainNotifier.RegisterBlockEpochNtfn(ctx)
if err != nil {
log.Errorf("unable to register for block epoch "+
"notifications: %v", err)
return err
}
err = m.recoverWithdrawals(ctx)
if err != nil {
log.Errorf("unable to recover withdrawals: %v", err)
return err
}