From 07578fe25f475bb81ad308f592de2d89016d8431 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 17 Mar 2014 11:13:35 +0100 Subject: [PATCH 1/3] Pretty print nonce --- ethchain/state_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index c2a31ff6c..e67f0f680 100644 --- a/ethchain/state_manager.go +++ b/ethchain/state_manager.go @@ -253,7 +253,7 @@ func (sm *StateManager) ValidateBlock(block *Block) error { // Verify the nonce of the block. Return an error if it's not valid if !sm.Pow.Verify(block.HashNoNonce(), block.Difficulty, block.Nonce) { - return ValidationError("Block's nonce is invalid (= %v)", block.Nonce) + return ValidationError("Block's nonce is invalid (= %v)", ethutil.Hex(block.Nonce)) } return nil From 2b9b02812e9c6f81b9e5422d5bd4f5ea425412df Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 17 Mar 2014 11:14:00 +0100 Subject: [PATCH 2/3] Log --- peer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/peer.go b/peer.go index 89b567fb6..4e927ada4 100644 --- a/peer.go +++ b/peer.go @@ -301,6 +301,7 @@ func (p *Peer) HandleInbound() { if ethutil.Config.Debug { ethutil.Config.Log.Infof("[PEER] Block %x failed\n", block.Hash()) ethutil.Config.Log.Infof("[PEER] %v\n", err) + ethutil.Config.Log.Infoln(block) } break } else { From 826c827e6b1922604601f15361c962aef6f7f1a0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 17 Mar 2014 11:15:09 +0100 Subject: [PATCH 3/3] Added a copy method to state --- ethchain/state.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ethchain/state.go b/ethchain/state.go index be25fe7b4..b9c2c576d 100644 --- a/ethchain/state.go +++ b/ethchain/state.go @@ -112,6 +112,10 @@ func (s *State) Cmp(other *State) bool { return s.trie.Cmp(other.trie) } +func (s *State) Copy() *State { + return NewState(s.trie.Copy()) +} + type ObjType byte const (