core, core/state: only write necessary state. Skip intermediate

This commit is contained in:
Jeffrey Wilcke
2015-06-30 23:49:34 +02:00
parent 6f69b4d61f
commit 08caeedd84
3 changed files with 21 additions and 11 deletions

View File

@@ -243,7 +243,7 @@ func (sm *BlockProcessor) processWithParent(block, parent *types.Block) (logs st
// Commit state objects/accounts to a temporary trie (does not save)
// used to calculate the state root.
state.Update()
state.CleanUpdate()
if header.Root != state.Root() {
err = fmt.Errorf("invalid merkle root. received=%x got=%x", header.Root, state.Root())
return