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
7392f59e
Unverified
Commit
7392f59e
authored
May 27, 2019
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/rawdb: keep genesis in key-value store for full sync too
parent
611113e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
freezer.go
core/rawdb/freezer.go
+10
-4
No files found.
core/rawdb/freezer.go
View file @
7392f59e
...
...
@@ -335,8 +335,11 @@ func (f *freezer) freeze(db ethdb.KeyValueStore) {
// Wipe out all data from the active database
batch
:=
db
.
NewBatch
()
for
i
:=
0
;
i
<
len
(
ancients
);
i
++
{
DeleteBlockWithoutNumber
(
batch
,
ancients
[
i
],
first
+
uint64
(
i
))
DeleteCanonicalHash
(
batch
,
first
+
uint64
(
i
))
// Always keep the genesis block in active database
if
first
+
uint64
(
i
)
!=
0
{
DeleteBlockWithoutNumber
(
batch
,
ancients
[
i
],
first
+
uint64
(
i
))
DeleteCanonicalHash
(
batch
,
first
+
uint64
(
i
))
}
}
if
err
:=
batch
.
Write
();
err
!=
nil
{
log
.
Crit
(
"Failed to delete frozen canonical blocks"
,
"err"
,
err
)
...
...
@@ -344,8 +347,11 @@ func (f *freezer) freeze(db ethdb.KeyValueStore) {
batch
.
Reset
()
// Wipe out side chain also.
for
number
:=
first
;
number
<
f
.
frozen
;
number
++
{
for
_
,
hash
:=
range
ReadAllHashes
(
db
,
number
)
{
DeleteBlock
(
batch
,
hash
,
number
)
// Always keep the genesis block in active database
if
number
!=
0
{
for
_
,
hash
:=
range
ReadAllHashes
(
db
,
number
)
{
DeleteBlock
(
batch
,
hash
,
number
)
}
}
}
if
err
:=
batch
.
Write
();
err
!=
nil
{
...
...
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