diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-09-28 17:53:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-28 17:53:54 +0800 |
commit | 437c3863f1917762e7f7474bd8b5c7ad78714d9c (patch) | |
tree | 154eb1fc771c9d809dc537a5ae45418263ad0770 /core/blockchain.go | |
parent | 863d166c7b0250cf2e99c8aad69578cdd144d386 (diff) | |
parent | 710435b51b97b4c688b70bda35ab9d1aa704a988 (diff) | |
download | dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.gz dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.bz2 dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.lz dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.xz dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.tar.zst dexon-437c3863f1917762e7f7474bd8b5c7ad78714d9c.zip |
Merge pull request #3053 from karalabe/fjl-state-trie-journal
core, trie: replace state caches with trie journal
Diffstat (limited to 'core/blockchain.go')
-rw-r--r-- | core/blockchain.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index a5f146a2d..1fbcdfc6f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -357,7 +357,12 @@ func (self *BlockChain) AuxValidator() pow.PoW { return self.pow } // State returns a new mutable state based on the current HEAD block. func (self *BlockChain) State() (*state.StateDB, error) { - return state.New(self.CurrentBlock().Root(), self.chainDb) + return self.StateAt(self.CurrentBlock().Root()) +} + +// StateAt returns a new mutable state based on a particular point in time. +func (self *BlockChain) StateAt(root common.Hash) (*state.StateDB, error) { + return self.stateCache.New(root) } // Reset purges the entire blockchain, restoring it to its genesis state. |