lnd+lncfg: move normalizeNetwork to lncfg

This commit is contained in:
Eugene authored and eugene committed 2020-10-29 15:20:00 -04:00
1 parent 4d238cfa2f
commit 46ef212de4
4 files changed
+17 -18

No files matched your search

+10
View File
@@ -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
}