diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-02 21:06:08 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-02 21:06:08 +0800 |
commit | 4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8 (patch) | |
tree | 1cc4369855586a5b59406d09299e89f8e3f9142d /vm/vm.go | |
parent | cfe037028081ebb84ee35caa5b16fed5d125b58a (diff) | |
parent | 65cad14f9b27db396d036f47814d4843d947ac43 (diff) | |
download | dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.gz dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.bz2 dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.lz dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.xz dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.zst dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.zip |
Merge branch 'develop' of github.com:ethereum/go-ethereum into removews
Conflicts:
cmd/ethereum/flags.go
cmd/mist/flags.go
Diffstat (limited to 'vm/vm.go')
-rw-r--r-- | vm/vm.go | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -16,6 +16,8 @@ type Vm struct { logStr string err error + // For logging + debug bool Dbg Debugger @@ -32,7 +34,7 @@ func New(env Environment) *Vm { lt = LogTyDiff } - return &Vm{env: env, logTy: lt, Recoverable: true} + return &Vm{debug: false, env: env, logTy: lt, Recoverable: true} } func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) { @@ -938,17 +940,21 @@ func (self *Vm) RunPrecompiled(p *PrecompiledAccount, callData []byte, context * } func (self *Vm) Printf(format string, v ...interface{}) VirtualMachine { - if self.logTy == LogTyPretty { - self.logStr += fmt.Sprintf(format, v...) + if self.debug { + if self.logTy == LogTyPretty { + self.logStr += fmt.Sprintf(format, v...) + } } return self } func (self *Vm) Endl() VirtualMachine { - if self.logTy == LogTyPretty { - vmlogger.Debugln(self.logStr) - self.logStr = "" + if self.debug { + if self.logTy == LogTyPretty { + vmlogger.Debugln(self.logStr) + self.logStr = "" + } } return self |