diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-02 18:37:33 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-02 18:37:33 +0800 |
commit | 99481a245adc2c4814ab6b38d94d63114f7bbb15 (patch) | |
tree | 947c32130249267c9cc0a9d0fd3b0a2bf77dda12 /chain/block_manager.go | |
parent | 9f7a8ea5e696f1329d0ea2d0a679c385887ee149 (diff) | |
download | go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.gz go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.bz2 go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.lz go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.xz go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.zst go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.zip |
Check for known block err and ignore
Diffstat (limited to 'chain/block_manager.go')
-rw-r--r-- | chain/block_manager.go | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/chain/block_manager.go b/chain/block_manager.go index 4d8d8dae6..c1a28e423 100644 --- a/chain/block_manager.go +++ b/chain/block_manager.go @@ -185,6 +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 } @@ -211,7 +212,7 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me fmt.Printf("## %x %x ##\n", block.Hash(), block.Number) } - receipts, err := sm.ApplyDiff(state, parent, block) + _, err = sm.ApplyDiff(state, parent, block) if err != nil { return } @@ -222,11 +223,13 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me return } - receiptSha := DeriveSha(receipts) - if bytes.Compare(receiptSha, block.ReceiptSha) != 0 { - err = fmt.Errorf("validating receipt root. received=%x got=%x", block.ReceiptSha, receiptSha) - return - } + /* + receiptSha := DeriveSha(receipts) + if bytes.Compare(receiptSha, block.ReceiptSha) != 0 { + err = fmt.Errorf("validating receipt root. received=%x got=%x", block.ReceiptSha, receiptSha) + return + } + */ // Block validation if err = sm.ValidateBlock(block, parent); err != nil { @@ -239,12 +242,14 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me return } - block.receipts = receipts // although this isn't necessary it be in the future - rbloom := CreateBloom(receipts) - if bytes.Compare(rbloom, block.LogsBloom) != 0 { - err = fmt.Errorf("unable to replicate block's bloom=%x", rbloom) - return - } + /* + block.receipts = receipts // although this isn't necessary it be in the future + rbloom := CreateBloom(receipts) + if bytes.Compare(rbloom, block.LogsBloom) != 0 { + err = fmt.Errorf("unable to replicate block's bloom=%x", rbloom) + return + } + */ state.Update(ethutil.Big0) @@ -266,6 +271,7 @@ 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 { |