aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_manager.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-03 22:08:13 +0800
committerzelig <viktor.tron@gmail.com>2014-07-03 22:08:13 +0800
commitde2da4fd19b53a541ffbddfa4360ceabef14f1a9 (patch)
treee1895a115645ae46b33ed33f5fcc148a1cd1a288 /ethchain/state_manager.go
parent198e5eeab9e2a7c359c12cdd5c8782dc56ae54ec (diff)
parent5d6713920625b82df2b55728b2cbb9f7f3df2025 (diff)
downloadgo-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar
go-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.gz
go-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.bz2
go-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.lz
go-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.xz
go-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.tar.zst
go-tangerine-de2da4fd19b53a541ffbddfa4360ceabef14f1a9.zip
Merge branch 'develop' of github.com:ethereum/eth-go into feature/clientid
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r--ethchain/state_manager.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go
index babfbd061..cec424583 100644
--- a/ethchain/state_manager.go
+++ b/ethchain/state_manager.go
@@ -6,6 +6,7 @@ import (
"fmt"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethlog"
+ "github.com/ethereum/eth-go/ethtrie"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"math/big"
@@ -205,7 +206,15 @@ 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
}