aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-09-27 18:13:13 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-09-28 16:27:31 +0800
commit710435b51b97b4c688b70bda35ab9d1aa704a988 (patch)
tree154eb1fc771c9d809dc537a5ae45418263ad0770 /eth/api.go
parentcd791bd855b55b95afc8a5c8f56b8bf67863d099 (diff)
downloaddexon-710435b51b97b4c688b70bda35ab9d1aa704a988.tar
dexon-710435b51b97b4c688b70bda35ab9d1aa704a988.tar.gz
dexon-710435b51b97b4c688b70bda35ab9d1aa704a988.tar.bz2
dexon-710435b51b97b4c688b70bda35ab9d1aa704a988.tar.lz
dexon-710435b51b97b4c688b70bda35ab9d1aa704a988.tar.xz
dexon-710435b51b97b4c688b70bda35ab9d1aa704a988.tar.zst
dexon-710435b51b97b4c688b70bda35ab9d1aa704a988.zip
core, eth, trie: reuse trie journals in all our code
Diffstat (limited to 'eth/api.go')
-rw-r--r--eth/api.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/eth/api.go b/eth/api.go
index d6c0826ed..c2fdbe99c 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -293,7 +293,7 @@ func (api *PublicDebugAPI) DumpBlock(number uint64) (state.Dump, error) {
if block == nil {
return state.Dump{}, fmt.Errorf("block #%d not found", number)
}
- stateDb, err := state.New(block.Root(), api.eth.ChainDb())
+ stateDb, err := api.eth.BlockChain().StateAt(block.Root())
if err != nil {
return state.Dump{}, err
}
@@ -406,7 +406,7 @@ func (api *PrivateDebugAPI) traceBlock(block *types.Block, logConfig *vm.LogConf
if err := core.ValidateHeader(api.config, blockchain.AuxValidator(), block.Header(), blockchain.GetHeader(block.ParentHash(), block.NumberU64()-1), true, false); err != nil {
return false, structLogger.StructLogs(), err
}
- statedb, err := state.New(blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1).Root(), api.eth.ChainDb())
+ statedb, err := blockchain.StateAt(blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1).Root())
if err != nil {
return false, structLogger.StructLogs(), err
}
@@ -501,7 +501,7 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common.
if parent == nil {
return nil, fmt.Errorf("block parent %x not found", block.ParentHash())
}
- stateDb, err := state.New(parent.Root(), api.eth.ChainDb())
+ stateDb, err := api.eth.BlockChain().StateAt(parent.Root())
if err != nil {
return nil, err
}