aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb/database.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethdb/database.go')
-rw-r--r--ethdb/database.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/ethdb/database.go b/ethdb/database.go
index f93731cfe..479c54b60 100644
--- a/ethdb/database.go
+++ b/ethdb/database.go
@@ -28,6 +28,7 @@ import (
"github.com/ethereum/go-ethereum/metrics"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/errors"
+ "github.com/syndtr/goleveldb/leveldb/filter"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
@@ -84,6 +85,7 @@ func NewLDBDatabase(file string, cache int, handles int) (*LDBDatabase, error) {
OpenFilesCacheCapacity: handles,
BlockCacheCapacity: cache / 2 * opt.MiB,
WriteBuffer: cache / 4 * opt.MiB, // Two of these are used internally
+ Filter: filter.NewBloomFilter(10),
})
if _, corrupted := err.(*errors.ErrCorrupted); corrupted {
db, err = leveldb.RecoverFile(file, nil)
@@ -98,6 +100,11 @@ func NewLDBDatabase(file string, cache int, handles int) (*LDBDatabase, error) {
}, nil
}
+// Path returns the path to the database directory.
+func (db *LDBDatabase) Path() string {
+ return db.fn
+}
+
// Put puts the given key / value to the queue
func (self *LDBDatabase) Put(key []byte, value []byte) error {
// Measure the database put latency, if requested