From 9de30d96f0362bc885d75a27bbd9c3d02af2d983 Mon Sep 17 00:00:00 2001 From: zelig Date: Thu, 3 Jul 2014 17:36:24 +0100 Subject: Modify main wrappers - clientIdentifier now set in main wrappers - version handled within wrapper - modify InitConfig now returning *ethutil.ConfigManager (passed to gui) - added NewClientIdentity returning *ethwire.SimpleClientIdentiy (passed to ethereum) --- ethereal/main.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'ethereal') diff --git a/ethereal/main.go b/ethereal/main.go index f3f1d3140..645e8f2ce 100644 --- a/ethereal/main.go +++ b/ethereal/main.go @@ -8,6 +8,11 @@ import ( "runtime" ) +const ( + ClientIdentifier = "Ethereal" + Version = "0.5.16" +) + func main() { // Leave QT on top at ALL times. Qt Needs to be initialized from the main thread qml.Init(nil) @@ -23,7 +28,8 @@ func main() { // precedence: code-internal flag default < config file < environment variables < command line Init() // parsing command line - utils.InitConfig(ConfigFile, Datadir, Identifier, "ETH") + + config := utils.InitConfig(ConfigFile, Datadir, "ETH") utils.InitDataDir(Datadir) @@ -36,7 +42,9 @@ func main() { // create, import, export keys utils.KeyTasks(keyManager, KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive) - ethereum := utils.NewEthereum(db, keyManager, UseUPnP, OutboundPort, MaxPeer) + clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier) + + ethereum := utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer) if ShowGenesis { utils.ShowGenesis(ethereum) @@ -46,7 +54,7 @@ func main() { utils.StartRpc(ethereum, RpcPort) } - gui := NewWindow(ethereum, KeyRing, LogLevel) + gui := NewWindow(ethereum, config, clientIdentity, KeyRing, LogLevel) utils.RegisterInterrupt(func(os.Signal) { gui.Stop() -- cgit v1.2.3