Removal of manual updating of state objects
* You'll only ever need to update the state by calling Update. Update will take care of the updating of it's child state objects.
This commit is contained in:
@ -181,7 +181,6 @@ func (sm *StateManager) ProcessBlock(state *State, parent, block *Block, dontRea
|
||||
coinbase.SetGasPool(block.CalcGasLimit(parent))
|
||||
|
||||
// Process the transactions on to current block
|
||||
//sm.ApplyTransactions(block.Coinbase, state, parent, block.Transactions())
|
||||
sm.ProcessTransactions(coinbase, state, block, parent, block.Transactions())
|
||||
|
||||
// Block validation
|
||||
@ -197,6 +196,9 @@ func (sm *StateManager) ProcessBlock(state *State, parent, block *Block, dontRea
|
||||
return err
|
||||
}
|
||||
|
||||
// Update the state with pending changes
|
||||
state.Update()
|
||||
|
||||
if !block.State().Cmp(state) {
|
||||
return fmt.Errorf("Invalid merkle root.\nrec: %x\nis: %x", block.State().trie.Root, state.trie.Root)
|
||||
}
|
||||
|
Reference in New Issue
Block a user