cmd/lncli: observe the --force parameter in the closechannel command
This commit is contained in:
parent
a9f0caff87
commit
1a357755d7
@ -11,13 +11,13 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/BitfuryLightning/tools/prefix_tree"
|
||||||
|
"github.com/BitfuryLightning/tools/rt"
|
||||||
|
"github.com/BitfuryLightning/tools/rt/graph"
|
||||||
"github.com/lightningnetwork/lnd/lnrpc"
|
"github.com/lightningnetwork/lnd/lnrpc"
|
||||||
"github.com/roasbeef/btcd/wire"
|
"github.com/roasbeef/btcd/wire"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"github.com/BitfuryLightning/tools/rt"
|
|
||||||
"github.com/BitfuryLightning/tools/prefix_tree"
|
|
||||||
"github.com/BitfuryLightning/tools/rt/graph"
|
|
||||||
|
|
||||||
"github.com/BitfuryLightning/tools/rt/visualizer"
|
"github.com/BitfuryLightning/tools/rt/visualizer"
|
||||||
)
|
)
|
||||||
@ -285,7 +285,7 @@ var CloseChannelCommand = cli.Command{
|
|||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "force",
|
Name: "force",
|
||||||
Usage: "after the time limit has passed, attempted an " +
|
Usage: "after the time limit has passed, attempt an " +
|
||||||
"uncooperative closure",
|
"uncooperative closure",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
@ -305,11 +305,13 @@ func closeChannel(ctx *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(roasbeef): implement time deadline within server
|
||||||
req := &lnrpc.CloseChannelRequest{
|
req := &lnrpc.CloseChannelRequest{
|
||||||
ChannelPoint: &lnrpc.ChannelPoint{
|
ChannelPoint: &lnrpc.ChannelPoint{
|
||||||
FundingTxid: txid[:],
|
FundingTxid: txid[:],
|
||||||
OutputIndex: uint32(ctx.Int("output_index")),
|
OutputIndex: uint32(ctx.Int("output_index")),
|
||||||
},
|
},
|
||||||
|
Force: ctx.Bool("force"),
|
||||||
}
|
}
|
||||||
|
|
||||||
stream, err := client.CloseChannel(ctxb, req)
|
stream, err := client.CloseChannel(ctxb, req)
|
||||||
@ -597,11 +599,11 @@ func showRoutingTableAsText(ctx *cli.Context) error {
|
|||||||
client := getClient(ctx)
|
client := getClient(ctx)
|
||||||
|
|
||||||
r, err := getRoutingTable(ctxb, client)
|
r, err := getRoutingTable(ctxb, client)
|
||||||
if err != nil{
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.Bool("table") && ctx.Bool("human"){
|
if ctx.Bool("table") && ctx.Bool("human") {
|
||||||
return fmt.Errorf("--table and --human cannot be used at the same time")
|
return fmt.Errorf("--table and --human cannot be used at the same time")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,7 +622,7 @@ func showRoutingTableAsImage(ctx *cli.Context) error {
|
|||||||
client := getClient(ctx)
|
client := getClient(ctx)
|
||||||
|
|
||||||
r, err := getRoutingTable(ctxb, client)
|
r, err := getRoutingTable(ctxb, client)
|
||||||
if err != nil{
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,7 +653,7 @@ func showRoutingTableAsImage(ctx *cli.Context) error {
|
|||||||
}
|
}
|
||||||
// if the filename is not specified explicitly use tempfile
|
// if the filename is not specified explicitly use tempfile
|
||||||
if imgDest == "" {
|
if imgDest == "" {
|
||||||
imageFile, err = TempFileWithSuffix("", "rt_", "."+ imgType)
|
imageFile, err = TempFileWithSuffix("", "rt_", "."+imgType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -734,7 +736,7 @@ func TempFileWithSuffix(dir, prefix, suffix string) (*os.File, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer os.Remove(f.Name())
|
defer os.Remove(f.Name())
|
||||||
f, err = os.Create(f.Name()+suffix)
|
f, err = os.Create(f.Name() + suffix)
|
||||||
return f, err
|
return f, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user