Commit 06978eb3 authored by szh's avatar szh

update statmap

parent ab8c6a70
...@@ -84,6 +84,16 @@ func SyncBlock() { ...@@ -84,6 +84,16 @@ func SyncBlock() {
if v != nil && v.Addr != "" { if v != nil && v.Addr != "" {
if _,ok:= statMap[v.Addr];!ok { if _,ok:= statMap[v.Addr];!ok {
statMap[v.Addr] = v statMap[v.Addr] = v
} else {
temp := statMap[v.Addr]
statMap[v.Addr] = &models.RaspMinerStat{
Addr:v.Addr,
MiningTicketCount:v.MiningTicketCount+temp.MiningTicketCount,
MinedTicketCount:v.MinedTicketCount+temp.MiningTicketCount,
MinedAmount:v.MinedAmount+temp.MinedAmount,
Height:v.Height,
Time:v.Time,
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment