// Close stops all goroutines and waits for them to complete.
Close stops all goroutines and waits for them to complete.
// Close stops all goroutines and waits for them to complete .
func (l *Ledger) Close() {
	l.syncManager.Stop()
	if l.consensusStop != nil {
		close(l.consensusStop)
	}
	l.consensus.Wait()
	if l.cancelGC != nil {
		l.cancelGC()
	}
	l.queryWorkerPool.Stop()
	l.stallDetector.Stop()
	l.collapseResultsLogger.Stop()
	l.stopWG.Wait()
}
func ( l * Ledger ) Close ( ) { l . syncManager . Stop ( ) if l . consensusStop != nil { close ( l . consensusStop ) } l . consensus . Wait ( ) if l . cancelGC != nil { l . cancelGC ( ) } l . queryWorkerPool . Stop ( ) l . stallDetector . Stop ( ) l . collapseResultsLogger . Stop ( ) l . stopWG . Wait ( ) }
Close stops all goroutines and waits for them to complete.
Close stops all goroutines and waits for them to complete .