aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb/database.go
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-01-31 01:03:31 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-31 01:03:31 +0800
commit017b9f7eacd1048661b22b7892caf680deb2b548 (patch)
treee94115fdb225e7da6fe046fde71ce0e53bb15b23 /ethdb/database.go
parent6198c53e28200b3a575f4545cbfa83c585e44b76 (diff)
downloadgo-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.tar
go-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.tar.gz
go-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.tar.bz2
go-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.tar.lz
go-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.tar.xz
go-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.tar.zst
go-tangerine-017b9f7eacd1048661b22b7892caf680deb2b548.zip
core, ethdb: reuse database batches (#15989)
* leveldb: Update leveldb to 211f780 (poolfix) * core, ethdb: reuse database batches
Diffstat (limited to 'ethdb/database.go')
-rw-r--r--ethdb/database.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/ethdb/database.go b/ethdb/database.go
index 93755dd7e..9a7c85d9e 100644
--- a/ethdb/database.go
+++ b/ethdb/database.go
@@ -299,6 +299,10 @@ func (b *ldbBatch) ValueSize() int {
return b.size
}
+func (b *ldbBatch) Reset() {
+ b.b.Reset()
+}
+
type table struct {
db Database
prefix string
@@ -358,3 +362,7 @@ func (tb *tableBatch) Write() error {
func (tb *tableBatch) ValueSize() int {
return tb.batch.ValueSize()
}
+
+func (tb *tableBatch) Reset() {
+ tb.batch.Reset()
+}