aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/config.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-26 06:42:07 +0800
committerobscuren <geffobscura@gmail.com>2014-05-26 06:42:07 +0800
commitb1463b2dc23ebd072f5e1e2c9a74842fc7ff51db (patch)
tree96e360fc19b7c0a37172d6d27d1221bf175228e6 /ethutil/config.go
parent4e1c6a8a22924d06a2a972c024891cebcf8ea054 (diff)
parent1f3f76cb092e84bd2e90950f0d43d7657eae878e (diff)
downloaddexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.gz
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.bz2
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.lz
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.xz
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.tar.zst
dexon-b1463b2dc23ebd072f5e1e2c9a74842fc7ff51db.zip
Merge branch 'release/poc5-rc9'
Diffstat (limited to 'ethutil/config.go')
-rw-r--r--ethutil/config.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/ethutil/config.go b/ethutil/config.go
index 1b41c4634..40ab3aa69 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -19,6 +19,7 @@ type config struct {
Ver string
ClientString string
Pubkey []byte
+ Identifier string
}
var Config *config
@@ -26,7 +27,7 @@ var Config *config
// Read config
//
// Initialize the global Config variable with default settings
-func ReadConfig(base string, logTypes LoggerType) *config {
+func ReadConfig(base string, logTypes LoggerType, id string) *config {
if Config == nil {
usr, _ := user.Current()
path := path.Join(usr.HomeDir, base)
@@ -42,7 +43,8 @@ func ReadConfig(base string, logTypes LoggerType) *config {
}
}
- Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC8"}
+ Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC9"}
+ Config.Identifier = id
Config.Log = NewLogger(logTypes, LogLevelDebug)
Config.SetClientString("/Ethereum(G)")
}
@@ -53,7 +55,11 @@ func ReadConfig(base string, logTypes LoggerType) *config {
// Set client string
//
func (c *config) SetClientString(str string) {
- Config.ClientString = fmt.Sprintf("%s nv%s/%s", str, c.Ver, runtime.GOOS)
+ id := runtime.GOOS
+ if len(c.Identifier) > 0 {
+ id = c.Identifier
+ }
+ Config.ClientString = fmt.Sprintf("%s nv%s/%s", str, c.Ver, id)
}
type LoggerType byte