lnd+lncfg: move normalizeNetwork to lncfg
This commit is contained in:
1 parent
4d238cfa2f
commit
46ef212de4
4 files changed
+17
-18
No files matched your search
@@ -87,3 +87,13 @@ func CleanAndExpandPath(path string) string {
|
||||
// but the variables can still be expanded via POSIX-style $VARIABLE.
|
||||
return filepath.Clean(os.ExpandEnv(path))
|
||||
}
|
||||
|
||||
// NormalizeNetwork returns the common name of a network type used to create
|
||||
// file paths. This allows differently versioned networks to use the same path.
|
||||
func NormalizeNetwork(network string) string {
|
||||
if strings.HasPrefix(network, "testnet") {
|
||||
return "testnet"
|
||||
}
|
||||
|
||||
return network
|
||||
}
|
||||
Reference in new issue
Block a user