From c3681daf9557415c339450e48b629d80e636f739 Mon Sep 17 00:00:00 2001
From: Jono Wenger <jono@elixxir.io>
Date: Wed, 29 Dec 2021 12:38:26 -0800
Subject: [PATCH] Don't start old transfer recovery thread if there is nothing
 to recover

---
 fileTransfer/oldTransferRecovery.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fileTransfer/oldTransferRecovery.go b/fileTransfer/oldTransferRecovery.go
index a2d493168..329445539 100644
--- a/fileTransfer/oldTransferRecovery.go
+++ b/fileTransfer/oldTransferRecovery.go
@@ -49,6 +49,13 @@ func (m Manager) oldTransferRecovery(healthyChan chan bool, chanID uint64) {
 		return
 	}
 
+	// Return if there are no parts to recover
+	if len(sentRounds) == 0 {
+		jww.TRACE.Print(
+			"[FT] No in-progress rounds from old transfers to recover.")
+		return
+	}
+
 	// Update parts that were sent by looking up the status of the rounds they
 	// were sent on
 	go func(healthyChan chan bool, chanID uint64,
-- 
GitLab