diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-17 17:06:06 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-17 17:06:06 +0800 |
commit | 53e30f750dd0c91279bfebe01bb12fd170cb74ff (patch) | |
tree | b14fcd5845ce21c774ae7730bdd1d42f8836e5a2 /ethchain/state_manager.go | |
parent | 6656f99c54aef4aaf03ba76dcab3df1cc363ab9a (diff) | |
download | go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.gz go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.bz2 go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.lz go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.xz go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.zst go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.zip |
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.
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r-- | ethchain/state_manager.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index 36bb14846..a0051181f 100644 --- a/ethchain/state_manager.go +++ b/ethchain/state_manager.go @@ -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) } |