Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligaishun
chain33-pai
Commits
7a46a9f3
Commit
7a46a9f3
authored
Oct 16, 2019
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update bug
parent
6353044e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
transaction.go
models/transaction.go
+8
-7
pai.go
service/pai_service/pai.go
+1
-1
No files found.
models/transaction.go
View file @
7a46a9f3
...
...
@@ -87,13 +87,14 @@ func UpdateBlocks(rt map[int64]*RaspMinerTxs,rs map[string]*RaspMinerStat,height
}
}
else
{
//存在 则更新状态
if
err
:=
tx
.
Model
(
&
RaspMinerStat
{})
.
Where
(
"Addr = ? "
,
v
.
Addr
)
.
Update
(
&
RaspMinerStat
{
MinedAmount
:
prev
.
MinedAmount
+
v
.
MinedAmount
,
MinedTicketCount
:
prev
.
MinedTicketCount
+
v
.
MinedTicketCount
,
MiningTicketCount
:
prev
.
MiningTicketCount
+
v
.
MiningTicketCount
,
Height
:
v
.
Height
,
Time
:
v
.
Time
,
})
.
Error
;
err
!=
nil
{
new
:=
make
(
map
[
string
]
interface
{},
0
)
new
[
"mined_amount"
]
=
prev
.
MinedAmount
+
v
.
MinedAmount
new
[
"mined_ticket_count"
]
=
prev
.
MinedTicketCount
+
v
.
MinedTicketCount
new
[
"mining_ticket_count"
]
=
prev
.
MiningTicketCount
+
v
.
MiningTicketCount
new
[
"height"
]
=
v
.
Height
new
[
"time"
]
=
v
.
Time
if
err
:=
tx
.
Model
(
&
RaspMinerStat
{})
.
Where
(
"Addr = ? "
,
v
.
Addr
)
.
Update
(
new
)
.
Error
;
err
!=
nil
{
tx
.
Rollback
()
return
err
}
...
...
service/pai_service/pai.go
View file @
7a46a9f3
...
...
@@ -167,7 +167,7 @@ func (p *Pai) GetTicketInfo(req *ReqTicketInfo) (*MinedInfo,error) {
return
nil
,
err
}
if
req
.
Detail
{
txs
,
err
:=
models
.
GetMinerTxs
(
req
.
Page
,
req
.
Pageszie
,
map
[
string
]
interface
{}{
"
add
r"
:
req
.
Addr
})
txs
,
err
:=
models
.
GetMinerTxs
(
req
.
Page
,
req
.
Pageszie
,
map
[
string
]
interface
{}{
"
mine
r"
:
req
.
Addr
})
if
err
!=
nil
{
logging
.
Error
(
"models.GetAddrs err"
,
err
)
return
nil
,
err
...
...
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