From ee3ecd1f0568ce149c85e2f61e2bca9a6884b7e2 Mon Sep 17 00:00:00 2001
From: jbhusson <jonah@elixxir.io>
Date: Tue, 2 Aug 2022 13:44:01 -0400
Subject: [PATCH] Use outer channel variable

---
 cmd/broadcast.go | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/cmd/broadcast.go b/cmd/broadcast.go
index 2a8d8e315..f6487332c 100644
--- a/cmd/broadcast.go
+++ b/cmd/broadcast.go
@@ -72,10 +72,9 @@ var broadcastCmd = &cobra.Command{
 				jww.FATAL.Panicf("description cannot be empty")
 			}
 
-			var cryptChannel *crypto.Channel
 			if viper.GetBool(broadcastNewFlag) {
 				// Create a new broadcast channel
-				cryptChannel, pk, err = crypto.NewChannel(name, desc, user.GetRng().GetStream())
+				channel, pk, err = crypto.NewChannel(name, desc, user.GetRng().GetStream())
 				if err != nil {
 					jww.FATAL.Panicf("Failed to create new channel: %+v", err)
 				}
@@ -103,7 +102,7 @@ var broadcastCmd = &cobra.Command{
 					jww.FATAL.Panicf("Failed to generate channel ID: %+v", err)
 				}
 
-				cryptChannel = &crypto.Channel{
+				channel = &crypto.Channel{
 					ReceptionID: rid,
 					Name:        name,
 					Description: desc,
@@ -113,7 +112,7 @@ var broadcastCmd = &cobra.Command{
 			}
 
 			// Save channel to disk
-			cBytes, err := cryptChannel.Marshal()
+			cBytes, err := channel.Marshal()
 			if err != nil {
 				jww.ERROR.Printf("Failed to marshal channel to bytes: %+v", err)
 			}
-- 
GitLab