diff --git a/chain/block_manager.go b/chain/block_manager.go index c1a28e423..9133475b6 100644 --- a/chain/block_manager.go +++ b/chain/block_manager.go @@ -185,8 +185,7 @@ func (sm *BlockManager) Process(block *Block) (td *big.Int, msgs state.Messages, defer sm.mutex.Unlock() if sm.bc.HasBlock(block.Hash()) { - fmt.Println("already having this block") - return nil, nil, nil + return nil, nil, &KnownBlockError{block.Number, block.Hash()} } if !sm.bc.HasBlock(block.PrevHash) { @@ -233,12 +232,10 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me // Block validation if err = sm.ValidateBlock(block, parent); err != nil { - statelogger.Errorln("validating block:", err) return } if err = sm.AccumelateRewards(state, block, parent); err != nil { - statelogger.Errorln("accumulating reward", err) return } @@ -271,7 +268,6 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me sm.transState = state.Copy() sm.eth.TxPool().RemoveSet(block.Transactions()) - fmt.Println("TD", td) return td, messages, nil } else { diff --git a/chain/chain_manager.go b/chain/chain_manager.go index 3448b02dd..45af61e48 100644 --- a/chain/chain_manager.go +++ b/chain/chain_manager.go @@ -330,10 +330,10 @@ func (self *ChainManager) InsertChain(chain Blocks) error { continue } + chainlogger.Infof("block process failed %v (%x)\n", block.Number, block.Hash()[:4]) return err } - fmt.Println(td, messages, err) self.add(block) self.SetTotalDifficulty(td) self.Ethereum.EventMux().Post(NewBlockEvent{block}) diff --git a/chain/error.go b/chain/error.go index 7dce2b608..0c4d6e59e 100644 --- a/chain/error.go +++ b/chain/error.go @@ -128,12 +128,12 @@ func IsTDError(e error) bool { } type KnownBlockError struct { - number uint64 + number *big.Int hash []byte } func (self *KnownBlockError) Error() string { - return fmt.Sprintf("block %d already known (%x)", self.number, self.hash[0:4]) + return fmt.Sprintf("block %v already known (%x)", self.number, self.hash[0:4]) } func IsKnownBlockErr(e error) bool { _, ok := e.(*KnownBlockError) diff --git a/cmd/mist/assets/qml/views/miner.qml b/cmd/mist/assets/qml/views/miner.qml index 2d59bb3a4..e0182649f 100644 --- a/cmd/mist/assets/qml/views/miner.qml +++ b/cmd/mist/assets/qml/views/miner.qml @@ -119,12 +119,14 @@ Rectangle { } } Component.onCompleted: { + /* // XXX Temp. replace with above eventually var tmpItems = ["JEVCoin", "Some coin", "Other coin", "Etc coin"]; var address = "e6716f9544a56c530d868e4bfbacb172315bdead"; for (var i = 0; i < tmpItems.length; i++) { mergedMiningModel.append({checked: false, name: tmpItems[i], address: address, id: 0, itemId: i}); } + */ } } }