Commit e9ff5339 authored by szh's avatar szh

update import bug

parent 2a6cd6ec
......@@ -64,6 +64,7 @@ func SyncBlock() {
txsMap := make(map[int64]*models.RaspMinerTxs,0)
statList := make([]*models.RaspMinerStat,0)
txsList := make([]*models.RaspMinerTxs,0)
checkList := make(map[int64]int64,0)
var wg sync.WaitGroup
for height := processHeight ;height < processHeight + maxDownload;height ++ {
wg.Add(1)
......@@ -77,6 +78,7 @@ func SyncBlock() {
statList = append(statList,stat)
txsList = append(txsList,txs)
logging.Info("DealBlock",height)
checkList[height] = height
}(height)
}
//db.SetMainNetHeight(int(processHeight + types.MaxProcessBlocks + 1))
......@@ -107,11 +109,29 @@ func SyncBlock() {
}
if len(txsList) != int(maxDownload) || len(txsList) != len(statList) {
logging.Error("txsList",len(txsList),"txsMap",len(txsMap),"statList",len(statList))
for _, v:= range txsList {
logging.Info("==txslist",*v)
for _,v:= range checkList {
var t, s bool
for _, vv:= range txsList {
if v == vv.Height {
t = true
break
}
}
for _, vv:= range statList {
if v == vv.Height {
s = true
break
}
}
if !t || !s {
logging.Error("++++++++",v)
}
}
for _, vv:= range txsList {
logging.Info("txslist:",*vv)
}
for _, v:= range statList {
logging.Info("==statList",*v)
for _, vv:= range statList {
logging.Info("statList:",*vv)
}
panic("exception txs not eq expect")
}
......@@ -119,7 +139,7 @@ func SyncBlock() {
if err != nil {
panic(err)
}
prev.LocalHeight += prev.DownloadHeight + 1
prev.LocalHeight += maxDownload
logging.Info("startHeight:",processHeight," endHeight:",processHeight+maxDownload-1)
}
......
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