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.
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user