Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-sectorbuilder
Commits
2c6f1269
Unverified
Commit
2c6f1269
authored
Jan 07, 2020
by
Jakub Sztandera
Browse files
Fix challange counts
Signed-off-by:
Jakub Sztandera
<
kubuxu@protocol.ai
>
parent
0cbb2c48
Changes
1
Hide whitespace changes
Inline
Side-by-side
params_shared.go
View file @
2c6f1269
...
...
@@ -9,10 +9,10 @@ const SectorChallengeRatioDiv = 25
const
MaxFallbackPostChallengeCount
=
10
// extracted from lotus/chain/types/blockheader
func
ElectionPostChallengeCount
(
sectors
uint64
,
faults
int
)
uint64
{
if
sectors
==
0
{
func
ElectionPostChallengeCount
(
sectors
uint64
,
faults
u
int
64
)
uint64
{
if
sectors
-
faults
==
0
{
return
0
}
// ceil(sectors / SectorChallengeRatioDiv)
return
(
sectors
-
uint64
(
faults
)
-
1
)
/
SectorChallengeRatioDiv
+
1
return
(
sectors
-
faults
-
1
)
/
SectorChallengeRatioDiv
+
1
}
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