aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-01 18:07:14 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-04 08:51:36 +0800
commitab16ce70fc68d9ab1b7d8cda57c180b4785cab6a (patch)
treeb6d294b8fbe8ba7f34a9f78f676ca99758a58bf5 /core/chain_makers.go
parent08caeedd842526373d30a929e63101a5fe7fda55 (diff)
downloadgo-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.tar
go-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.tar.gz
go-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.tar.bz2
go-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.tar.lz
go-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.tar.xz
go-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.tar.zst
go-tangerine-ab16ce70fc68d9ab1b7d8cda57c180b4785cab6a.zip
core, miner, tests: renamed state methods
* Update => SyncIntermediate * Added SyncObjects SyncIntermediate only updates whatever has changed, but, as a side effect, requires much more disk space. SyncObjects will only sync whatever is required for a block and will not save intermediate state to disk. As drawback this requires more time when more txs come in.
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r--core/chain_makers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go
index 37475e0ae..c46f627f8 100644
--- a/core/chain_makers.go
+++ b/core/chain_makers.go
@@ -77,7 +77,7 @@ func (b *BlockGen) AddTx(tx *types.Transaction) {
if err != nil {
panic(err)
}
- b.statedb.Update()
+ b.statedb.SyncIntermediate()
b.header.GasUsed.Add(b.header.GasUsed, gas)
receipt := types.NewReceipt(b.statedb.Root().Bytes(), b.header.GasUsed)
logs := b.statedb.GetLogs(tx.Hash())
@@ -135,7 +135,7 @@ func GenerateChain(parent *types.Block, db common.Database, n int, gen func(int,
gen(i, b)
}
AccumulateRewards(statedb, h, b.uncles)
- statedb.Update()
+ statedb.SyncIntermediate()
h.Root = statedb.Root()
return types.NewBlock(h, b.txs, b.uncles, b.receipts)
}