aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-26 07:47:04 +0800
committerobscuren <geffobscura@gmail.com>2014-04-26 07:47:04 +0800
commite16fd323e800297602a60b7a0e7b7897a55d2fa0 (patch)
tree1c27a3bc225af36d6b0b2117ba6b649cc3983110 /ethereum
parentd0438ac10ab55cd12c1ab5ec3aaf0030185bf131 (diff)
downloadgo-tangerine-e16fd323e800297602a60b7a0e7b7897a55d2fa0.tar.gz
go-tangerine-e16fd323e800297602a60b7a0e7b7897a55d2fa0.tar.zst
go-tangerine-e16fd323e800297602a60b7a0e7b7897a55d2fa0.zip
Leverage the new watch & address:changed functionality
Diffstat (limited to 'ethereum')
-rw-r--r--ethereum/ethereum.go32
1 files changed, 17 insertions, 15 deletions
diff --git a/ethereum/ethereum.go b/ethereum/ethereum.go
index 881f39ece..04851d2bd 100644
--- a/ethereum/ethereum.go
+++ b/ethereum/ethereum.go
@@ -53,22 +53,24 @@ func main() {
var logSys *log.Logger
flags := log.LstdFlags
+ ethutil.ReadConfig(DataDir)
+ logger := ethutil.Config.Log
+
if LogFile != "" {
- logfile, err := os.OpenFile(LogFile, os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
- if err != nil {
- panic(fmt.Sprintf("error opening log file '%s': %v", LogFile, err))
- }
- defer logfile.Close()
+ logfile, err := os.OpenFile(LogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
+ if err != nil {
+ panic(fmt.Sprintf("error opening log file '%s': %v", LogFile, err))
+ }
+ defer logfile.Close()
log.SetOutput(logfile)
logSys = log.New(logfile, "", flags)
- } else {
- logSys = log.New(os.Stdout, "", flags)
- }
- ethutil.ReadConfig(DataDir)
- logger := ethutil.Config.Log
- logger.AddLogSystem(logSys)
+ logger.AddLogSystem(logSys)
+ }
+ /*else {
+ logSys = log.New(os.Stdout, "", flags)
+ }*/
- ethchain.InitFees()
+ ethchain.InitFees()
ethutil.Config.Seed = UseSeed
// Instantiated a eth stack
@@ -101,9 +103,6 @@ func main() {
}
}
os.Exit(0)
- case len(ImportKey) == 0:
- utils.CreateKeyPair(false)
- fallthrough
case ExportKey:
key := ethutil.Config.Db.GetKeys()[0]
logSys.Println(fmt.Sprintf("prvk: %x\n", key.PrivateKey))
@@ -111,6 +110,9 @@ func main() {
case ShowGenesis:
logSys.Println(ethereum.BlockChain().Genesis())
os.Exit(0)
+ default:
+ // Creates a keypair if non exists
+ utils.CreateKeyPair(false)
}
// client