aboutsummaryrefslogtreecommitdiffstats
path: root/chain/block_manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'chain/block_manager.go')
-rw-r--r--chain/block_manager.go30
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 {