core, ethdb: reuse database batches (#15989)

* leveldb: Update leveldb to 211f780 (poolfix)

* core, ethdb: reuse database batches
This commit is contained in:
Martin Holst Swende
2018-01-30 18:03:31 +01:00
committed by Péter Szilágyi
parent 6198c53e28
commit 017b9f7eac
4 changed files with 16 additions and 1 deletions

View File

@ -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()
}