lncli: remove chain option from profile

This commit is contained in:
Elle Mouton
2023-08-03 18:22:41 +02:00
committed by Olaoluwa Osuntokun
parent 7fa05f92f5
commit a7e723e570
2 changed files with 1 additions and 13 deletions

View File

@@ -278,16 +278,6 @@ func contextWithMetadata(ctx context.Context,
// extractPathArgs parses the TLS certificate and macaroon paths from the
// command.
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"))
switch network {
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
// macaroon that we need.
macPath = filepath.Join(
lndDir, defaultDataDir, defaultChainSubDir, chain,
lndDir, defaultDataDir, defaultChainSubDir, "bitcoin",
network, defaultMacaroonFilename,
)
}

View File

@@ -27,7 +27,6 @@ type profileEntry struct {
Name string `json:"name"`
RPCServer string `json:"rpcserver"`
LndDir string `json:"lnddir"`
Chain string `json:"chain"`
Network string `json:"network"`
NoMacaroons bool `json:"no-macaroons,omitempty"` // nolint:tagliatelle
TLSCert string `json:"tlscert"`
@@ -153,7 +152,6 @@ func profileFromContext(ctx *cli.Context, store, skipMacaroons bool) (
LndDir: lncfg.CleanAndExpandPath(
ctx.GlobalString("lnddir"),
),
Chain: ctx.GlobalString("chain"),
Network: ctx.GlobalString("network"),
NoMacaroons: ctx.GlobalBool("no-macaroons"),
TLSCert: string(tlsCert),