mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
fn: remove uneeded argument of ctxBlocking
Removed 'cancel' argument, because it is called only in case the context has already expired and the only action that cancel function did was cancelling the context.
This commit is contained in:
parent
865da9c525
commit
1750aec13d
1 changed files with 3 additions and 7 deletions
|
@ -149,7 +149,7 @@ func (g *ContextGuard) Create(ctx context.Context,
|
|||
}
|
||||
|
||||
if opts.blocking {
|
||||
g.ctxBlocking(ctx, cancel)
|
||||
g.ctxBlocking(ctx)
|
||||
|
||||
return ctx, cancel
|
||||
}
|
||||
|
@ -196,14 +196,10 @@ func (g *ContextGuard) ctxQuitUnsafe(ctx context.Context,
|
|||
}
|
||||
|
||||
// ctxBlocking spins off a goroutine that will block until the passed context
|
||||
// is cancelled after which it will call the passed cancel function and
|
||||
// decrement the wait group.
|
||||
func (g *ContextGuard) ctxBlocking(ctx context.Context,
|
||||
cancel context.CancelFunc) {
|
||||
|
||||
// is cancelled after which it will decrement the wait group.
|
||||
func (g *ContextGuard) ctxBlocking(ctx context.Context) {
|
||||
g.wg.Add(1)
|
||||
go func() {
|
||||
defer cancel()
|
||||
defer g.wg.Done()
|
||||
|
||||
select {
|
||||
|
|
Loading…
Add table
Reference in a new issue