Merge pull request #7163 from akovalenko/master

cmd/lncli/walletrpc_active.go: avoid nested getContext
This commit is contained in:
Oliver Gugger 2022-11-17 10:59:45 +01:00 committed by GitHub
commit ad2870135c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ package main
import (
"bytes"
"context"
"encoding/base64"
"encoding/hex"
"encoding/json"
@ -320,7 +321,9 @@ func bumpCloseFee(ctx *cli.Context) error {
defer cleanUp()
// Fetch waiting close channel commitments.
commitments, err := getWaitingCloseCommitments(client, channelPoint)
commitments, err := getWaitingCloseCommitments(
ctxc, client, channelPoint,
)
if err != nil {
return err
}
@ -379,11 +382,9 @@ func bumpCloseFee(ctx *cli.Context) error {
return nil
}
func getWaitingCloseCommitments(client lnrpc.LightningClient,
channelPoint string) (*lnrpc.PendingChannelsResponse_Commitments,
error) {
ctxc := getContext()
func getWaitingCloseCommitments(ctxc context.Context,
client lnrpc.LightningClient, channelPoint string) (
*lnrpc.PendingChannelsResponse_Commitments, error) {
req := &lnrpc.PendingChannelsRequest{}
resp, err := client.PendingChannels(ctxc, req)