[lbry] enable regtest for --createtemp (temporary wallet)
This commit is contained in:
parent
f52bea1e37
commit
d6434b148a
1 changed files with 16 additions and 13 deletions
17
config.go
17
config.go
|
@ -442,21 +442,24 @@ func loadConfig() (*config, []string, error) {
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
if cfg.CreateTemp {
|
||||
errMsg := "Tried to create a temporary simulation wallet"
|
||||
// Exit if you try to use a simulation wallet with a standard
|
||||
// data directory.
|
||||
if !(cfg.AppDataDir.ExplicitlySet() || cfg.DataDir.ExplicitlySet()) && cfg.CreateTemp {
|
||||
fmt.Fprintln(os.Stderr, "Tried to create a temporary simulation "+
|
||||
"wallet, but failed to specify data directory!")
|
||||
if !(cfg.AppDataDir.ExplicitlySet() || cfg.DataDir.ExplicitlySet()) {
|
||||
errMsg += ", but failed to specify data directory!"
|
||||
fmt.Fprintln(os.Stderr, errMsg)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// Exit if you try to use a simulation wallet on anything other than
|
||||
// simnet or testnet3.
|
||||
if !cfg.SimNet && cfg.CreateTemp {
|
||||
fmt.Fprintln(os.Stderr, "Tried to create a temporary simulation "+
|
||||
"wallet for network other than simnet!")
|
||||
// simnet, regtest or testnet3.
|
||||
if !(cfg.Regtest || cfg.SimNet || cfg.TestNet3) {
|
||||
errMsg += "for network other than simnet, regtest, or testnet3"
|
||||
fmt.Fprintln(os.Stderr, errMsg)
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the wallet exists or create it when the create flag is set.
|
||||
netDir := networkDir(cfg.AppDataDir.Value, activeNet.Params)
|
||||
|
|
Loading…
Reference in a new issue