Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions staticaddr/deposit/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
9 changes: 6 additions & 3 deletions staticaddr/loopin/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,24 @@ 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
}

// Upon start of the loop-in manager we reinstate all previous loop-ins
// 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.
Expand Down
5 changes: 5 additions & 0 deletions staticaddr/withdraw/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down