Skip to content
Merged
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
22 changes: 12 additions & 10 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,17 +489,19 @@ func NewBee(
b.apiCloser = apiServer
}

// Sync the with the given Ethereum backend:
isSynced, _, err := transaction.IsSynced(ctx, chainBackend, maxDelay)
if err != nil {
return nil, fmt.Errorf("is synced: %w", err)
}
if !isSynced {
logger.Info("waiting to sync with the blockchain backend")

err := transaction.WaitSynced(ctx, logger, chainBackend, maxDelay)
if chainEnabled {
// Sync the with the given Ethereum backend:
isSynced, _, err := transaction.IsSynced(ctx, chainBackend, maxDelay)
if err != nil {
return nil, fmt.Errorf("waiting backend sync: %w", err)
return nil, fmt.Errorf("is synced: %w", err)
}
if !isSynced {
logger.Info("waiting to sync with the blockchain backend")

err := transaction.WaitSynced(ctx, logger, chainBackend, maxDelay)
if err != nil {
return nil, fmt.Errorf("waiting backend sync: %w", err)
}
}
}

Expand Down
Loading