lncli: remove chain option from profile
This commit is contained in:
1 parent
7fa05f92f5
commit
a7e723e570
2 files changed
+1
-13
No files matched your search
+1
-11
@@ -278,16 +278,6 @@ func contextWithMetadata(ctx context.Context,
|
|||||||
// extractPathArgs parses the TLS certificate and macaroon paths from the
|
// extractPathArgs parses the TLS certificate and macaroon paths from the
|
||||||
// command.
|
// command.
|
||||||
func extractPathArgs(ctx *cli.Context) (string, string, error) {
|
func extractPathArgs(ctx *cli.Context) (string, string, error) {
|
||||||
// We'll start off by parsing the active chain and network. These are
|
|
||||||
// needed to determine the correct path to the macaroon when not
|
|
||||||
// specified.
|
|
||||||
chain := strings.ToLower(ctx.GlobalString("chain"))
|
|
||||||
switch chain {
|
|
||||||
case "bitcoin", "litecoin":
|
|
||||||
default:
|
|
||||||
return "", "", fmt.Errorf("unknown chain: %v", chain)
|
|
||||||
}
|
|
||||||
|
|
||||||
network := strings.ToLower(ctx.GlobalString("network"))
|
network := strings.ToLower(ctx.GlobalString("network"))
|
||||||
switch network {
|
switch network {
|
||||||
case "mainnet", "testnet", "regtest", "simnet", "signet":
|
case "mainnet", "testnet", "regtest", "simnet", "signet":
|
||||||
@@ -311,7 +301,7 @@ func extractPathArgs(ctx *cli.Context) (string, string, error) {
|
|||||||
// lnddir/data/chain/<chain>/<network> in order to fetch the
|
// lnddir/data/chain/<chain>/<network> in order to fetch the
|
||||||
// macaroon that we need.
|
// macaroon that we need.
|
||||||
macPath = filepath.Join(
|
macPath = filepath.Join(
|
||||||
lndDir, defaultDataDir, defaultChainSubDir, chain,
|
lndDir, defaultDataDir, defaultChainSubDir, "bitcoin",
|
||||||
network, defaultMacaroonFilename,
|
network, defaultMacaroonFilename,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ type profileEntry struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
RPCServer string `json:"rpcserver"`
|
RPCServer string `json:"rpcserver"`
|
||||||
LndDir string `json:"lnddir"`
|
LndDir string `json:"lnddir"`
|
||||||
Chain string `json:"chain"`
|
|
||||||
Network string `json:"network"`
|
Network string `json:"network"`
|
||||||
NoMacaroons bool `json:"no-macaroons,omitempty"` // nolint:tagliatelle
|
NoMacaroons bool `json:"no-macaroons,omitempty"` // nolint:tagliatelle
|
||||||
TLSCert string `json:"tlscert"`
|
TLSCert string `json:"tlscert"`
|
||||||
@@ -153,7 +152,6 @@ func profileFromContext(ctx *cli.Context, store, skipMacaroons bool) (
|
|||||||
LndDir: lncfg.CleanAndExpandPath(
|
LndDir: lncfg.CleanAndExpandPath(
|
||||||
ctx.GlobalString("lnddir"),
|
ctx.GlobalString("lnddir"),
|
||||||
),
|
),
|
||||||
Chain: ctx.GlobalString("chain"),
|
|
||||||
Network: ctx.GlobalString("network"),
|
Network: ctx.GlobalString("network"),
|
||||||
NoMacaroons: ctx.GlobalBool("no-macaroons"),
|
NoMacaroons: ctx.GlobalBool("no-macaroons"),
|
||||||
TLSCert: string(tlsCert),
|
TLSCert: string(tlsCert),
|
||||||
|
|||||||
Reference in new issue
Block a user