mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-04-01 00:19:54 +02:00
In this commit, we make sure that all the `wg.Add(1)` calls succeed before we attempt to wait on the shutdown of all the goroutines. Under rare scheduling scenarios, if both `Start` and `Disconnect` are called concurrently, then this internal race error can be hit, causing the panic to occur. Fixes https://github.com/lightningnetwork/lnd/issues/7853