diff options
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r-- | ethchain/state_manager.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index dea82cae3..c42238e5c 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" @@ -204,7 +205,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 comparison failed") + } + } + if !block.State().Cmp(state) { + err = fmt.Errorf("Invalid merkle root.\nrec: %x\nis: %x", block.State().trie.Root, state.trie.Root) return } |