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
0bbdcdcc
Commit
0bbdcdcc
authored
Nov 23, 2018
by
sanghg
Committed by
vipwzw
Nov 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issues #15
在可疑的代码处,增加日志进行追踪
parent
f7ee4f64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
ticket.go
plugin/dapp/ticket/wallet/ticket.go
+8
-1
No files found.
plugin/dapp/ticket/wallet/ticket.go
View file @
0bbdcdcc
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
package
wallet
package
wallet
import
(
import
(
"encoding/hex"
"fmt"
"fmt"
"sync"
"sync"
"sync/atomic"
"sync/atomic"
...
@@ -611,17 +612,20 @@ func (policy *ticketPolicy) buyTicket(height int64) ([][]byte, int, error) {
...
@@ -611,17 +612,20 @@ func (policy *ticketPolicy) buyTicket(height int64) ([][]byte, int, error) {
}
}
count
:=
0
count
:=
0
var
hashes
[][]
byte
var
hashes
[][]
byte
bizlog
.
Info
(
"ticketPolicy buyTicket begin"
)
for
_
,
priv
:=
range
privs
{
for
_
,
priv
:=
range
privs
{
hash
,
n
,
err
:=
policy
.
buyTicketOne
(
height
,
priv
)
hash
,
n
,
err
:=
policy
.
buyTicketOne
(
height
,
priv
)
if
err
!=
nil
{
if
err
!=
nil
{
bizlog
.
Error
(
"buyTicketOne"
,
"err"
,
err
)
bizlog
.
Error
(
"
ticketPolicy buyTicket
buyTicketOne"
,
"err"
,
err
)
continue
continue
}
}
count
+=
n
count
+=
n
if
hash
!=
nil
{
if
hash
!=
nil
{
hashes
=
append
(
hashes
,
hash
)
hashes
=
append
(
hashes
,
hash
)
}
}
bizlog
.
Info
(
"ticketPolicy buyTicket"
,
"Address"
,
address
.
PubKeyToAddress
(
priv
.
PubKey
()
.
Bytes
())
.
String
(),
"txhash"
,
hex
.
EncodeToString
(
hash
),
"n"
,
n
)
}
}
bizlog
.
Info
(
"ticketPolicy buyTicket end"
)
return
hashes
,
count
,
nil
return
hashes
,
count
,
nil
}
}
...
@@ -705,6 +709,7 @@ func (policy *ticketPolicy) buyMinerAddrTicket(height int64) ([][]byte, int, err
...
@@ -705,6 +709,7 @@ func (policy *ticketPolicy) buyMinerAddrTicket(height int64) ([][]byte, int, err
}
}
count
:=
0
count
:=
0
var
hashes
[][]
byte
var
hashes
[][]
byte
bizlog
.
Info
(
"ticketPolicy buyMinerAddrTicket begin"
)
for
_
,
priv
:=
range
privs
{
for
_
,
priv
:=
range
privs
{
hashlist
,
n
,
err
:=
policy
.
buyMinerAddrTicketOne
(
height
,
priv
)
hashlist
,
n
,
err
:=
policy
.
buyMinerAddrTicketOne
(
height
,
priv
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -717,7 +722,9 @@ func (policy *ticketPolicy) buyMinerAddrTicket(height int64) ([][]byte, int, err
...
@@ -717,7 +722,9 @@ func (policy *ticketPolicy) buyMinerAddrTicket(height int64) ([][]byte, int, err
if
hashlist
!=
nil
{
if
hashlist
!=
nil
{
hashes
=
append
(
hashes
,
hashlist
...
)
hashes
=
append
(
hashes
,
hashlist
...
)
}
}
bizlog
.
Info
(
"ticketPolicy buyMinerAddrTicket"
,
"Address"
,
address
.
PubKeyToAddress
(
priv
.
PubKey
()
.
Bytes
())
.
String
(),
"n"
,
n
)
}
}
bizlog
.
Info
(
"ticketPolicy buyMinerAddrTicket end"
)
return
hashes
,
count
,
nil
return
hashes
,
count
,
nil
}
}
...
...
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