mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-11 01:11:02 +02:00
Merge pull request #7163 from akovalenko/master
cmd/lncli/walletrpc_active.go: avoid nested getContext
This commit is contained in:
commit
ad2870135c
@ -5,6 +5,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@ -320,7 +321,9 @@ func bumpCloseFee(ctx *cli.Context) error {
|
|||||||
defer cleanUp()
|
defer cleanUp()
|
||||||
|
|
||||||
// Fetch waiting close channel commitments.
|
// Fetch waiting close channel commitments.
|
||||||
commitments, err := getWaitingCloseCommitments(client, channelPoint)
|
commitments, err := getWaitingCloseCommitments(
|
||||||
|
ctxc, client, channelPoint,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -379,11 +382,9 @@ func bumpCloseFee(ctx *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getWaitingCloseCommitments(client lnrpc.LightningClient,
|
func getWaitingCloseCommitments(ctxc context.Context,
|
||||||
channelPoint string) (*lnrpc.PendingChannelsResponse_Commitments,
|
client lnrpc.LightningClient, channelPoint string) (
|
||||||
error) {
|
*lnrpc.PendingChannelsResponse_Commitments, error) {
|
||||||
|
|
||||||
ctxc := getContext()
|
|
||||||
|
|
||||||
req := &lnrpc.PendingChannelsRequest{}
|
req := &lnrpc.PendingChannelsRequest{}
|
||||||
resp, err := client.PendingChannels(ctxc, req)
|
resp, err := client.PendingChannels(ctxc, req)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user