mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
update all block cache
Signed-off-by: Delweng <delweng@gmail.com>
This commit is contained in:
parent
cbe8bf82dc
commit
faca680a13
1 changed files with 6 additions and 2 deletions
|
|
@ -300,10 +300,14 @@ func (w *indexWriter) finish(batch ethdb.Batch) {
|
||||||
return // nothing to commit
|
return // nothing to commit
|
||||||
}
|
}
|
||||||
for _, bw := range writers {
|
for _, bw := range writers {
|
||||||
|
buf := bw.finish()
|
||||||
|
if key := fmt.Sprintf("%s:%d", w.state.String(), bw.desc.id); historyBlockCache.Contains(key) {
|
||||||
|
historyBlockCache.Add(key, buf)
|
||||||
|
}
|
||||||
if w.state.account {
|
if w.state.account {
|
||||||
rawdb.WriteAccountHistoryIndexBlock(batch, w.state.addressHash, bw.desc.id, bw.finish())
|
rawdb.WriteAccountHistoryIndexBlock(batch, w.state.addressHash, bw.desc.id, buf)
|
||||||
} else {
|
} else {
|
||||||
rawdb.WriteStorageHistoryIndexBlock(batch, w.state.addressHash, w.state.storageHash, bw.desc.id, bw.finish())
|
rawdb.WriteStorageHistoryIndexBlock(batch, w.state.addressHash, w.state.storageHash, bw.desc.id, buf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.frozen = nil // release all the frozen writers
|
w.frozen = nil // release all the frozen writers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue