aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-25 18:21:03 +0800
committerobscuren <geffobscura@gmail.com>2014-02-25 18:21:03 +0800
commit4f4175a3e295272025d312c800f65fc1a143a9ca (patch)
treedf4f7b5f5bbab312afd89e3809d3b1457632cf11 /ethdb
parentc7e73ba12d747186002433db54d002ab43bed171 (diff)
downloaddexon-4f4175a3e295272025d312c800f65fc1a143a9ca.tar
dexon-4f4175a3e295272025d312c800f65fc1a143a9ca.tar.gz
dexon-4f4175a3e295272025d312c800f65fc1a143a9ca.tar.bz2
dexon-4f4175a3e295272025d312c800f65fc1a143a9ca.tar.lz
dexon-4f4175a3e295272025d312c800f65fc1a143a9ca.tar.xz
dexon-4f4175a3e295272025d312c800f65fc1a143a9ca.tar.zst
dexon-4f4175a3e295272025d312c800f65fc1a143a9ca.zip
Addad db name for new ldb
Diffstat (limited to 'ethdb')
-rw-r--r--ethdb/database.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/ethdb/database.go b/ethdb/database.go
index 1e987920d..d1967f023 100644
--- a/ethdb/database.go
+++ b/ethdb/database.go
@@ -11,8 +11,8 @@ type LDBDatabase struct {
db *leveldb.DB
}
-func NewLDBDatabase() (*LDBDatabase, error) {
- dbPath := path.Join(ethutil.Config.ExecPath, "database")
+func NewLDBDatabase(name string) (*LDBDatabase, error) {
+ dbPath := path.Join(ethutil.Config.ExecPath, name)
// Open the db
db, err := leveldb.OpenFile(dbPath, nil)
@@ -40,6 +40,10 @@ func (db *LDBDatabase) Delete(key []byte) error {
return db.db.Delete(key, nil)
}
+func (db *LDBDatabase) Db() *leveldb.DB {
+ return db.db
+}
+
func (db *LDBDatabase) LastKnownTD() []byte {
data, _ := db.db.Get([]byte("LastKnownTotalDifficulty"), nil)