aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_manager.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-21 18:21:34 +0800
committerobscuren <geffobscura@gmail.com>2014-07-21 18:21:34 +0800
commit5d2669dbd35b9449cbbb249dcec89e2a64c90f30 (patch)
treee12a934fa2408210458a65c282aac815e21d4708 /ethchain/state_manager.go
parent9f00aeae29d53fec358fcecdc9bcc162b8e3984c (diff)
downloadgo-tangerine-5d2669dbd35b9449cbbb249dcec89e2a64c90f30.tar.gz
go-tangerine-5d2669dbd35b9449cbbb249dcec89e2a64c90f30.tar.zst
go-tangerine-5d2669dbd35b9449cbbb249dcec89e2a64c90f30.zip
Fixed tx sha creation
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r--ethchain/state_manager.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go
index f28f45eab..6a6c67492 100644
--- a/ethchain/state_manager.go
+++ b/ethchain/state_manager.go
@@ -201,11 +201,16 @@ func (sm *StateManager) Process(block *Block, dontReact bool) (err error) {
fmt.Printf("## %x %x ##\n", block.Hash(), block.Number)
}
- _, err = sm.ApplyDiff(state, parent, block)
+ receipts, err := sm.ApplyDiff(state, parent, block)
if err != nil {
return err
}
+ txSha := CreateTxSha(receipts)
+ if bytes.Compare(txSha, block.TxSha) != 0 {
+ return fmt.Errorf("Error validating tx sha. Received %x, got %x", block.TxSha, txSha)
+ }
+
// Block validation
if err = sm.ValidateBlock(block); err != nil {
statelogger.Errorln("Error validating block:", err)
@@ -219,17 +224,7 @@ func (sm *StateManager) Process(block *Block, dontReact bool) (err error) {
return err
}
- /*
- if ethutil.Config.Paranoia {
- valid, _ := ethtrie.ParanoiaCheck(state.trie)
- if !valid {
- err = fmt.Errorf("PARANOIA: World state trie corruption")
- }
- }
- */
-
if !block.State().Cmp(state) {
-
err = fmt.Errorf("Invalid merkle root.\nrec: %x\nis: %x", block.State().trie.Root, state.trie.Root)
return
}