aboutsummaryrefslogtreecommitdiffstats
path: root/chain/block_manager.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-11 19:16:36 +0800
committerobscuren <geffobscura@gmail.com>2014-11-11 19:16:36 +0800
commit75ee3b3f089e703b728bb301cc6b2abe4c111c41 (patch)
tree9087d865e296cbb93c590fe15cd9942353b70058 /chain/block_manager.go
parent9509322ecd8e709ce8a17442836b6ff15ba2edff (diff)
downloaddexon-75ee3b3f089e703b728bb301cc6b2abe4c111c41.tar.gz
dexon-75ee3b3f089e703b728bb301cc6b2abe4c111c41.tar.zst
dexon-75ee3b3f089e703b728bb301cc6b2abe4c111c41.zip
debugging code
Diffstat (limited to 'chain/block_manager.go')
-rw-r--r--chain/block_manager.go31
1 files changed, 20 insertions, 11 deletions
diff --git a/chain/block_manager.go b/chain/block_manager.go
index b7c805129..4431e3ba9 100644
--- a/chain/block_manager.go
+++ b/chain/block_manager.go
@@ -159,7 +159,9 @@ done:
txGas.Sub(txGas, st.gas)
cumulative := new(big.Int).Set(totalUsedGas.Add(totalUsedGas, txGas))
- receipt := &Receipt{ethutil.CopyBytes(state.Root().([]byte)), cumulative, LogsBloom(state.Logs()).Bytes(), state.Logs()}
+ bloom := ethutil.LeftPadBytes(LogsBloom(state.Logs()).Bytes(), 64)
+ receipt := &Receipt{ethutil.CopyBytes(state.Root()), cumulative, bloom, state.Logs()}
+ //fmt.Println(receipt)
// Notify all subscribers
go self.eth.EventMux().Post(TxPostEvent{tx})
@@ -213,13 +215,15 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
if err != nil {
return
}
- block.SetReceipts(receipts)
+ //block.SetReceipts(receipts)
- txSha := DeriveSha(block.transactions)
- if bytes.Compare(txSha, block.TxSha) != 0 {
- err = fmt.Errorf("Error validating transaction sha. Received %x, got %x", block.TxSha, txSha)
- return
- }
+ /*
+ txSha := DeriveSha(block.transactions)
+ if bytes.Compare(txSha, block.TxSha) != 0 {
+ err = fmt.Errorf("Error validating transaction sha. Received %x, got %x", block.TxSha, txSha)
+ return
+ }
+ */
receiptSha := DeriveSha(receipts)
if bytes.Compare(receiptSha, block.ReceiptSha) != 0 {
@@ -255,13 +259,18 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
// Sync the current block's state to the database and cancelling out the deferred Undo
state.Sync()
- // TODO at this point we should also insert LOGS in to a database
-
- sm.transState = state.Copy()
-
messages := state.Manifest().Messages
state.Manifest().Reset()
+ /*
+ sm.eth.ChainManager().SetTotalDifficulty(td)
+ sm.eth.ChainManager().add(block)
+ sm.eth.EventMux().Post(NewBlockEvent{block})
+ sm.eth.EventMux().Post(messages)
+ */
+
+ sm.transState = state.Copy()
+
sm.eth.TxPool().RemoveSet(block.Transactions())
return td, messages, nil