From 5b2e5d180fa79865b6319f4251a440da44a81809 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 14 Jul 2014 00:37:18 +0200 Subject: [PATCH] Changed diff output not to prefix hex with 0x --- ethchain/state.go | 4 ++-- ethchain/state_manager.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ethchain/state.go b/ethchain/state.go index 8df79dcef2..4faf691f20 100644 --- a/ethchain/state.go +++ b/ethchain/state.go @@ -212,9 +212,9 @@ func (self *State) Update() { // Debug stuff func (self *State) CreateOutputForDiff() { for addr, stateObject := range self.stateObjects { - fmt.Printf("0x%x 0x%x 0x%x 0x%x\n", addr, stateObject.state.Root(), stateObject.Amount.Bytes(), stateObject.Nonce) + fmt.Printf("%x %x %x %x\n", addr, stateObject.state.Root(), stateObject.Amount.Bytes(), stateObject.Nonce) stateObject.state.EachStorage(func(addr string, value *ethutil.Value) { - fmt.Printf("0x%x 0x%x\n", addr, value.Bytes()) + fmt.Printf("%x %x\n", addr, value.Bytes()) }) } } diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index 62fcda8a5c..f2ecd4b9f5 100644 --- a/ethchain/state_manager.go +++ b/ethchain/state_manager.go @@ -151,7 +151,7 @@ done: receipts = append(receipts, receipt) handled = append(handled, tx) - if ethutil.Config.Diff { + if ethutil.Config.Diff && ethutil.Config.DiffType == "all" { state.CreateOutputForDiff() } } @@ -187,8 +187,8 @@ func (sm *StateManager) Process(block *Block, dontReact bool) (err error) { // before that. defer state.Reset() - if ethutil.Config.Diff { - fmt.Printf("## 0x%x 0x%x ##\n", block.Hash(), block.Number) + if ethutil.Config.Diff && ethutil.Config.DiffType == "all" { + fmt.Printf("## %x %x ##\n", block.Hash(), block.Number) } receipts, err := sm.ApplyDiff(state, parent, block)