Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
4f4175a3
Commit
4f4175a3
authored
Feb 25, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addad db name for new ldb
parent
c7e73ba1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
database.go
ethdb/database.go
+6
-2
ethereum.go
ethereum.go
+1
-1
No files found.
ethdb/database.go
View file @
4f4175a3
...
...
@@ -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
)
...
...
ethereum.go
View file @
4f4175a3
...
...
@@ -61,7 +61,7 @@ type Ethereum struct {
}
func
New
(
caps
Caps
,
usePnp
bool
)
(
*
Ethereum
,
error
)
{
db
,
err
:=
ethdb
.
NewLDBDatabase
()
db
,
err
:=
ethdb
.
NewLDBDatabase
(
"database"
)
//db, err := ethdb.NewMemDatabase()
if
err
!=
nil
{
return
nil
,
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment