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
0c34eae1
Unverified
Commit
0c34eae1
authored
Nov 09, 2020
by
Péter Szilágyi
Committed by
GitHub
Nov 09, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21803 from holiman/ethash
consensus/ethash: fix the percentage progress report
parents
7c30f4d0
81ff7000
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
algorithm.go
consensus/ethash/algorithm.go
+4
-4
No files found.
consensus/ethash/algorithm.go
View file @
0c34eae1
...
...
@@ -295,7 +295,7 @@ func generateDataset(dest []uint32, epoch uint64, cache []uint32) {
var
pend
sync
.
WaitGroup
pend
.
Add
(
threads
)
var
progress
uint
32
var
progress
uint
64
for
i
:=
0
;
i
<
threads
;
i
++
{
go
func
(
id
int
)
{
defer
pend
.
Done
()
...
...
@@ -311,7 +311,7 @@ func generateDataset(dest []uint32, epoch uint64, cache []uint32) {
limit
=
uint32
(
size
/
hashBytes
)
}
// Calculate the dataset segment
percent
:=
uint32
(
size
/
hashBytes
/
100
)
percent
:=
size
/
hashBytes
/
100
for
index
:=
first
;
index
<
limit
;
index
++
{
item
:=
generateDatasetItem
(
cache
,
index
,
keccak512
)
if
swapped
{
...
...
@@ -319,8 +319,8 @@ func generateDataset(dest []uint32, epoch uint64, cache []uint32) {
}
copy
(
dataset
[
index
*
hashBytes
:
],
item
)
if
status
:=
atomic
.
AddUint
32
(
&
progress
,
1
);
status
%
percent
==
0
{
logger
.
Info
(
"Generating DAG in progress"
,
"percentage"
,
uint64
(
status
*
100
)
/
(
size
/
hashBytes
),
"elapsed"
,
common
.
PrettyDuration
(
time
.
Since
(
start
)))
if
status
:=
atomic
.
AddUint
64
(
&
progress
,
1
);
status
%
percent
==
0
{
logger
.
Info
(
"Generating DAG in progress"
,
"percentage"
,
(
status
*
100
)
/
(
size
/
hashBytes
),
"elapsed"
,
common
.
PrettyDuration
(
time
.
Since
(
start
)))
}
}
}(
i
)
...
...
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