aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/config.go10
-rw-r--r--ethutil/value.go2
2 files changed, 9 insertions, 3 deletions
diff --git a/ethutil/config.go b/ethutil/config.go
index 1b41c4634..e6cbde4b6 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)
@@ -43,6 +44,7 @@ func ReadConfig(base string, logTypes LoggerType) *config {
}
Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC8"}
+ 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
diff --git a/ethutil/value.go b/ethutil/value.go
index b7756f9b1..83600abc2 100644
--- a/ethutil/value.go
+++ b/ethutil/value.go
@@ -16,7 +16,7 @@ type Value struct {
}
func (val *Value) String() string {
- return fmt.Sprintf("%q", val.Val)
+ return fmt.Sprintf("%x", val.Val)
}
func NewValue(val interface{}) *Value {