From 129eeed4ba846cf97cd2c952e4d02b67315c1eb9 Mon Sep 17 00:00:00 2001 From: Maelkum Date: Mon, 15 Jul 2024 17:54:49 +0200 Subject: [PATCH] On node start subscribe to topics first --- node/run.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/run.go b/node/run.go index c52af9a0..95fb68d8 100644 --- a/node/run.go +++ b/node/run.go @@ -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.