Skip to content

Commit 4f69df4

Browse files
committed
discovery: add comments to the ctx creation
We highlight why we do not use the returned cancel method of the context guard.
1 parent 93ee6e2 commit 4f69df4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

discovery/syncer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ func (g *GossipSyncer) Start() {
409409
g.started.Do(func() {
410410
log.Debugf("Starting GossipSyncer(%x)", g.cfg.peerPub[:])
411411

412+
// We do not call the cancel function here, because the global
413+
// context quit method is enough to clean up the context guard.
412414
ctx, _ := g.cg.Create(context.Background())
413415

414416
// TODO(conner): only spawn channelGraphSyncer if remote

peer/brontide.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4127,6 +4127,8 @@ func (p *Brontide) startRbfChanCloser(shutdown shutdownInit,
41274127
defer rbfCloser.RemoveStateSub(coopCloseStates)
41284128
}
41294129

4130+
// We do not call the cancel function here, because the global
4131+
// context quit method is enough to clean up the context guard.
41304132
ctx, _ := p.cg.Create(context.Background())
41314133
feeRate := defaultFeePerKw.FeePerVByte()
41324134

0 commit comments

Comments
 (0)