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
34f72ddb
Commit
34f72ddb
authored
Dec 23, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decode from stream directly
parent
1382e8d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
main.go
cmd/ethereum/main.go
+2
-3
database.go
ethdb/database.go
+4
-0
No files found.
cmd/ethereum/main.go
View file @
34f72ddb
...
...
@@ -18,7 +18,6 @@
package
main
import
(
"bytes"
"fmt"
"os"
"runtime"
...
...
@@ -120,13 +119,13 @@ func main() {
if
len
(
ImportChain
)
>
0
{
clilogger
.
Infof
(
"importing chain '%s'
\n
"
,
ImportChain
)
c
,
err
:=
ethutil
.
ReadAllFile
(
ImportChain
)
fh
,
err
:=
os
.
OpenFile
(
ImportChain
,
os
.
O_RDONLY
,
os
.
ModePerm
)
if
err
!=
nil
{
clilogger
.
Infoln
(
err
)
return
}
var
chain
types
.
Blocks
if
err
:=
rlp
.
Decode
(
bytes
.
NewReader
([]
byte
(
c
))
,
&
chain
);
err
!=
nil
{
if
err
:=
rlp
.
Decode
(
fh
,
&
chain
);
err
!=
nil
{
clilogger
.
Infoln
(
err
)
return
}
...
...
ethdb/database.go
View file @
34f72ddb
...
...
@@ -71,6 +71,10 @@ func (self *LDBDatabase) NewIterator() iterator.Iterator {
return
self
.
db
.
NewIterator
(
nil
,
nil
)
}
func
(
self
*
LDBDatabase
)
Write
(
batch
*
leveldb
.
Batch
)
error
{
return
self
.
db
.
Write
(
batch
,
nil
)
}
func
(
self
*
LDBDatabase
)
Close
()
{
// Close the leveldb database
self
.
db
.
Close
()
...
...
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