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
74dbc202
Unverified
Commit
74dbc202
authored
Feb 08, 2021
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state/pruner: fix compaction range error
parent
944d9014
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
pruner.go
core/state/pruner/pruner.go
+5
-6
No files found.
core/state/pruner/pruner.go
View file @
74dbc202
...
...
@@ -186,16 +186,15 @@ func prune(maindb ethdb.Database, stateBloom *stateBloom, middleStateRoots map[c
// Note for small pruning, the compaction is skipped.
if
count
>=
rangeCompactionThreshold
{
cstart
:=
time
.
Now
()
for
b
:=
byte
(
0
);
b
<
byte
(
16
);
b
++
{
for
b
:=
0x00
;
b
<=
0xf0
;
b
+=
0x10
{
var
(
start
=
[]
byte
{
b
<<
4
}
end
=
[]
byte
{
(
b
+
1
)
<<
4
-
1
}
start
=
[]
byte
{
b
yte
(
b
)
}
end
=
[]
byte
{
byte
(
b
+
0x10
)
}
)
log
.
Info
(
"Compacting database"
,
"range"
,
fmt
.
Sprintf
(
"%#x-%#x"
,
start
,
end
),
"elapsed"
,
common
.
PrettyDuration
(
time
.
Since
(
cstart
)))
if
b
==
15
{
if
b
==
0xf0
{
end
=
nil
}
log
.
Info
(
"Compacting database"
,
"range"
,
fmt
.
Sprintf
(
"%#x-%#x"
,
start
,
end
),
"elapsed"
,
common
.
PrettyDuration
(
time
.
Since
(
cstart
)))
if
err
:=
maindb
.
Compact
(
start
,
end
);
err
!=
nil
{
log
.
Error
(
"Database compaction failed"
,
"error"
,
err
)
return
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