diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-22 23:35:26 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-22 23:35:26 +0800 |
commit | 230aafbf66ba747fb3796810adf3b1680f368e73 (patch) | |
tree | 66aff77b70bf083cc1a7ce32ab108d39d82ac95d /ethutil/config.go | |
parent | 14787ac148274a84478aa06fd985407b9241cd50 (diff) | |
download | dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.gz dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.bz2 dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.lz dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.xz dexon-230aafbf66ba747fb3796810adf3b1680f368e73.tar.zst dexon-230aafbf66ba747fb3796810adf3b1680f368e73.zip |
Working on interop
* Receipts after each transaction
* Fee structure
* Applying fees to miners
Diffstat (limited to 'ethutil/config.go')
-rw-r--r-- | ethutil/config.go | 10 |
1 files changed, 8 insertions, 2 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 |