Skip to content

Commit

Permalink
universe: don't use goroutine to send
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guggero committed Oct 17, 2023
1 parent a2dc44d commit 24b2494
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion universe/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 24b2494

Please sign in to comment.