diff options
author | Maran <maran.hidskes@gmail.com> | 2014-03-17 18:15:28 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-03-17 18:15:28 +0800 |
commit | 2be2fc79740d942f9690268352465d117930f081 (patch) | |
tree | d5c7faec2888f6149be259d741ec3301b5bc75e5 | |
parent | 095d5baaed03f1077f39a468c11fb3aae1446a58 (diff) | |
parent | 826c827e6b1922604601f15361c962aef6f7f1a0 (diff) | |
download | dexon-2be2fc79740d942f9690268352465d117930f081.tar dexon-2be2fc79740d942f9690268352465d117930f081.tar.gz dexon-2be2fc79740d942f9690268352465d117930f081.tar.bz2 dexon-2be2fc79740d942f9690268352465d117930f081.tar.lz dexon-2be2fc79740d942f9690268352465d117930f081.tar.xz dexon-2be2fc79740d942f9690268352465d117930f081.tar.zst dexon-2be2fc79740d942f9690268352465d117930f081.zip |
Merge branch 'develop' into miner
-rw-r--r-- | ethchain/state.go | 4 | ||||
-rw-r--r-- | ethchain/state_manager.go | 2 | ||||
-rw-r--r-- | peer.go | 1 |
3 files changed, 6 insertions, 1 deletions
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 ( diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index c01084fc6..3be940745 100644 --- a/ethchain/state_manager.go +++ b/ethchain/state_manager.go @@ -266,7 +266,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 @@ -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 { |