diff options
author | zelig <viktor.tron@gmail.com> | 2014-07-15 01:32:54 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-07-15 01:32:54 +0800 |
commit | 353ecbb7d78d9669c42545f152f291f869b39c02 (patch) | |
tree | f3cbb4ad253708b55001d658737578d9713dca52 /ethereum | |
parent | 6b296d907b848e2a3dbc78ea5c04c3c3d719d9bd (diff) | |
parent | e53acdc2ac45fa8953afc3392ed81653d6f26326 (diff) | |
download | dexon-353ecbb7d78d9669c42545f152f291f869b39c02.tar dexon-353ecbb7d78d9669c42545f152f291f869b39c02.tar.gz dexon-353ecbb7d78d9669c42545f152f291f869b39c02.tar.bz2 dexon-353ecbb7d78d9669c42545f152f291f869b39c02.tar.lz dexon-353ecbb7d78d9669c42545f152f291f869b39c02.tar.xz dexon-353ecbb7d78d9669c42545f152f291f869b39c02.tar.zst dexon-353ecbb7d78d9669c42545f152f291f869b39c02.zip |
Merge branch 'develop' of github.com:ethereum/go-ethereum into feature/ethutil-refactor
Diffstat (limited to 'ethereum')
-rw-r--r-- | ethereum/flags.go | 2 | ||||
-rw-r--r-- | ethereum/javascript_runtime.go | 16 | ||||
-rw-r--r-- | ethereum/main.go | 8 |
3 files changed, 18 insertions, 8 deletions
diff --git a/ethereum/flags.go b/ethereum/flags.go index d5a9c3a8a..af0fd9a69 100644 --- a/ethereum/flags.go +++ b/ethereum/flags.go @@ -11,6 +11,7 @@ import ( var Identifier string var KeyRing string +var DiffTool bool var KeyStore string var StartRpc bool var RpcPort int @@ -66,6 +67,7 @@ func Init() { flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file") flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)") flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)") + flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0") flag.BoolVar(&StartMining, "mine", false, "start dagger mining") flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console") diff --git a/ethereum/javascript_runtime.go b/ethereum/javascript_runtime.go index 6e107e376..852a50487 100644 --- a/ethereum/javascript_runtime.go +++ b/ethereum/javascript_runtime.go @@ -6,7 +6,6 @@ import ( "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethpub" - "github.com/ethereum/eth-go/ethreact" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/utils" "github.com/obscuren/otto" @@ -23,8 +22,8 @@ type JSRE struct { vm *otto.Otto lib *ethpub.PEthereum - blockChan chan ethreact.Event - changeChan chan ethreact.Event + blockChan chan ethutil.React + changeChan chan ethutil.React quitChan chan bool objectCb map[string][]otto.Value @@ -49,8 +48,8 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE { ethereum, otto.New(), ethpub.NewPEthereum(ethereum), - make(chan ethreact.Event), - make(chan ethreact.Event), + make(chan ethutil.React, 1), + make(chan ethutil.React, 1), make(chan bool), make(map[string][]otto.Value), } @@ -64,9 +63,6 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE { // We have to make sure that, whoever calls this, calls "Stop" go re.mainLoop() - // Subscribe to events - reactor := ethereum.Reactor() - reactor.Subscribe("newBlock", re.blockChan) re.Bind("eth", &JSEthereum{re.lib, re.vm}) @@ -112,6 +108,10 @@ func (self *JSRE) Stop() { } func (self *JSRE) mainLoop() { + // Subscribe to events + reactor := self.ethereum.Reactor() + reactor.Subscribe("newBlock", self.blockChan) + out: for { select { diff --git a/ethereum/main.go b/ethereum/main.go index e4d73d494..39226c1d2 100644 --- a/ethereum/main.go +++ b/ethereum/main.go @@ -2,6 +2,7 @@ package main import ( "github.com/ethereum/eth-go/ethlog" + "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/utils" "runtime" ) @@ -20,7 +21,14 @@ func main() { // precedence: code-internal flag default < config file < environment variables < command line Init() // parsing command line + + // If the difftool option is selected ignore all other log output + if DiffTool { + LogLevel = 0 + } + utils.InitConfig(ConfigFile, Datadir, "ETH") + ethutil.Config.Diff = DiffTool utils.InitDataDir(Datadir) |