From 24b249455e1421d1bb104bea3ab36a74465c141c Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 17 Oct 2023 20:08:48 +0200 Subject: [PATCH] universe: don't use goroutine to send Since we're closing the fetchedLeaves channel right below this call, it's very likely that we run into a "send on closed channel" panic. We fix that by making the send synchronous. --- universe/syncer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universe/syncer.go b/universe/syncer.go index 02c990dec..dacde6d75 100644 --- a/universe/syncer.go +++ b/universe/syncer.go @@ -285,7 +285,7 @@ func (s *SimpleSyncer) syncRoot(ctx context.Context, remoteRoot BaseRoot, transferLeaves[j].Leaf.Proof.BlockHeight }) - go fn.SendAll(fetchedLeaves, transferLeaves...) + fn.SendAll(fetchedLeaves, transferLeaves...) } // And now we wait for the batch streamer to finish as well.