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
4914e587
Commit
4914e587
authored
Dec 03, 2018
by
wjx@disanbo.com
Committed by
vipwzw
Dec 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gofmt
parent
5cafee06
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lotterydb.go
plugin/dapp/lottery/executor/lotterydb.go
+4
-4
No files found.
plugin/dapp/lottery/executor/lotterydb.go
View file @
4914e587
...
...
@@ -53,7 +53,7 @@ const (
const
(
luckyNumMol
=
100000
decimal
=
100000000
//1e8
randMolNum
=
5
//
randMolNum = 5
grpcRecSize
int
=
5
*
30
*
1024
*
1024
blockNum
=
5
)
...
...
@@ -521,14 +521,14 @@ func (action *Action) findLuckyNum(isSolo bool, lott *LotteryDB) int64 {
var
err
error
var
hash
[]
byte
if
isSolo
{
//used for internal verfication
//used for internal ver
i
fication
num
=
12345
}
else
{
//发消息给randnum模块
//在主链上,当前高度查询不到,如果要保证区块个数,高度传入action.height-1
llog
.
Debug
(
"findLuckyNum on randnum module"
)
if
!
types
.
IsPara
()
{
req
:=
&
types
.
ReqRandHash
{
ExecName
:
"ticket"
,
Height
:
action
.
height
-
1
,
BlockNum
:
5
}
req
:=
&
types
.
ReqRandHash
{
ExecName
:
"ticket"
,
Height
:
action
.
height
-
1
,
BlockNum
:
blockNum
}
msg
,
err
=
action
.
api
.
Query
(
"ticket"
,
"RandNumHash"
,
req
)
if
err
!=
nil
{
return
-
1
...
...
@@ -541,7 +541,7 @@ func (action *Action) findLuckyNum(isSolo bool, lott *LotteryDB) int64 {
llog
.
Error
(
"findLuckyNum"
,
"mainHeight"
,
mainHeight
)
return
-
1
}
req
:=
&
types
.
ReqRandHash
{
ExecName
:
"ticket"
,
Height
:
mainHeight
,
BlockNum
:
5
}
req
:=
&
types
.
ReqRandHash
{
ExecName
:
"ticket"
,
Height
:
mainHeight
,
BlockNum
:
blockNum
}
reply
,
err
:=
action
.
grpcClient
.
QueryRandNum
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
-
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