mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-15 23:52:37 +02:00
config: cookie missing error fix
This commit is contained in:
16
config.go
16
config.go
@ -2001,10 +2001,6 @@ func extractBitcoindRPCParams(networkName, bitcoindDataDir, bitcoindConfigPath,
|
|||||||
return "", "", "", "", err
|
return "", "", "", "", err
|
||||||
}
|
}
|
||||||
userSubmatches := rpcUserRegexp.FindSubmatch(configContents)
|
userSubmatches := rpcUserRegexp.FindSubmatch(configContents)
|
||||||
if userSubmatches == nil {
|
|
||||||
return "", "", "", "", fmt.Errorf("unable to find rpcuser in " +
|
|
||||||
"config")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Similarly, we'll use another regular expression to find the set
|
// Similarly, we'll use another regular expression to find the set
|
||||||
// rpcpass (if any). If we can't find the pass, then we'll exit with an
|
// rpcpass (if any). If we can't find the pass, then we'll exit with an
|
||||||
@ -2014,6 +2010,18 @@ func extractBitcoindRPCParams(networkName, bitcoindDataDir, bitcoindConfigPath,
|
|||||||
return "", "", "", "", err
|
return "", "", "", "", err
|
||||||
}
|
}
|
||||||
passSubmatches := rpcPassRegexp.FindSubmatch(configContents)
|
passSubmatches := rpcPassRegexp.FindSubmatch(configContents)
|
||||||
|
|
||||||
|
// Exit with an error if the cookie file, is defined in config, and
|
||||||
|
// can not be found, with both rpcuser and rpcpassword undefined.
|
||||||
|
if rpcCookiePath != "" && userSubmatches == nil && passSubmatches == nil {
|
||||||
|
return "", "", "", "", fmt.Errorf("unable to open cookie file (%v)",
|
||||||
|
rpcCookiePath)
|
||||||
|
}
|
||||||
|
|
||||||
|
if userSubmatches == nil {
|
||||||
|
return "", "", "", "", fmt.Errorf("unable to find rpcuser in " +
|
||||||
|
"config")
|
||||||
|
}
|
||||||
if passSubmatches == nil {
|
if passSubmatches == nil {
|
||||||
return "", "", "", "", fmt.Errorf("unable to find rpcpassword " +
|
return "", "", "", "", fmt.Errorf("unable to find rpcpassword " +
|
||||||
"in config")
|
"in config")
|
||||||
|
@ -258,6 +258,8 @@ from occurring that would result in an erroneous force close.](https://github.co
|
|||||||
|
|
||||||
* [Some of the invoice update logic has been refactored to be less verbose.](https://github.com/lightningnetwork/lnd/pull/6415)
|
* [Some of the invoice update logic has been refactored to be less verbose.](https://github.com/lightningnetwork/lnd/pull/6415)
|
||||||
|
|
||||||
|
* [Clarify error msg when bitcoind cookie file is missing](https://github.com/lightningnetwork/lnd/pull/6536).
|
||||||
|
|
||||||
## RPC Server
|
## RPC Server
|
||||||
|
|
||||||
* [Add value to the field
|
* [Add value to the field
|
||||||
|
Reference in New Issue
Block a user