Skip to content

Commit

Permalink
On node start subscribe to topics first
Browse files Browse the repository at this point in the history
  • Loading branch information
Maelkum committed Jul 15, 2024
1 parent 51b9b88 commit 129eeed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions node/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
// Run will start the main loop for the node.
func (n *Node) Run(ctx context.Context) error {

err := n.host.ConnectToKnownPeers(ctx)
err := n.subscribeToTopics(ctx)
if err != nil {
return fmt.Errorf("could not connect to known peers: %w", err)
return fmt.Errorf("could not subscribe to topics: %w", err)
}

err = n.subscribeToTopics(ctx)
err = n.host.ConnectToKnownPeers(ctx)
if err != nil {
return fmt.Errorf("could not subscribe to topics: %w", err)
return fmt.Errorf("could not connect to known peers: %w", err)
}

// Sync functions now in case they were removed from the storage.
Expand Down

0 comments on commit 129eeed

Please sign in to comment.