Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
48080b16
Commit
48080b16
authored
Dec 05, 2018
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix frozen overflow
parent
4c3e8aef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
means.go
plugin/dapp/unfreeze/executor/means.go
+3
-3
means_test.go
plugin/dapp/unfreeze/executor/means_test.go
+5
-0
No files found.
plugin/dapp/unfreeze/executor/means.go
View file @
48080b16
...
...
@@ -73,11 +73,11 @@ func (opt *leftProportion) calcFrozen(unfreeze *pty.Unfreeze, now int64) (int64,
return
0
,
types
.
ErrInvalidParam
}
unfreezeTimes
:=
(
now
+
means
.
Period
-
unfreeze
.
StartTime
)
/
means
.
Period
frozen
:=
unfreeze
.
TotalCount
frozen
:=
float64
(
unfreeze
.
TotalCount
)
for
i
:=
int64
(
0
);
i
<
unfreezeTimes
;
i
++
{
frozen
=
frozen
*
(
10000
-
means
.
TenThousandth
)
/
10000
frozen
=
frozen
*
float64
(
10000
-
means
.
TenThousandth
)
/
10000
}
return
frozen
,
nil
return
int64
(
frozen
)
,
nil
}
func
withdraw
(
unfreeze
*
pty
.
Unfreeze
,
frozen
int64
)
(
*
pty
.
Unfreeze
,
int64
)
{
...
...
plugin/dapp/unfreeze/executor/means_test.go
0 → 100644
View file @
48080b16
package
main
func
main
()
{
}
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