aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-03-26 22:48:31 +0800
committerFelix Lange <fjl@users.noreply.github.com>2019-03-26 22:48:31 +0800
commit59e195324643e8f3a18396b529e3350e550fdecc (patch)
tree80850abf25e40b1e3a5bd359dacc654b651d8c73 /core/blockchain.go
parentdf717abc999add34c5725ab86dce1fcee968ca10 (diff)
downloadgo-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.gz
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.bz2
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.lz
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.xz
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.zst
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.zip
core, ethdb, trie: mode dirty data to clean cache on flush (#19307)
This PR is a more advanced form of the dirty-to-clean cacher (#18995), where we reuse previous database write batches as datasets to uncache, saving a dirty-trie-iteration and a dirty-trie-rlp-reencoding per block.
Diffstat (limited to 'core/blockchain.go')
-rw-r--r--core/blockchain.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index 5d5c5e680..08302d057 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -301,7 +301,7 @@ func (bc *BlockChain) SetHead(head uint64) error {
defer bc.chainmu.Unlock()
// Rewind the header chain, deleting all block bodies until then
- delFn := func(db ethdb.Deleter, hash common.Hash, num uint64) {
+ delFn := func(db ethdb.Writer, hash common.Hash, num uint64) {
rawdb.DeleteBody(db, hash, num)
}
bc.hc.SetHead(head, delFn)