We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a7b526 commit e302fd0Copy full SHA for e302fd0
discovery/syncer.go
@@ -532,6 +532,21 @@ func (g *GossipSyncer) channelGraphSyncer(ctx context.Context) {
532
defer g.cg.WgDone()
533
534
for {
535
+ // Check cancellation before processing any state.
536
+ select {
537
+ case <-ctx.Done():
538
+ log.Debugf("GossipSyncer(%x): context canceled, "+
539
+ "exiting", g.cfg.peerPub[:])
540
+
541
+ return
542
+ case <-g.cg.Done():
543
+ log.Debugf("GossipSyncer(%x): shutting down",
544
+ g.cfg.peerPub[:])
545
546
547
+ default:
548
+ }
549
550
state := g.syncState()
551
syncType := g.SyncType()
552
0 commit comments