fix: sync error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-07-11 15:52:17 +08:00
parent 13607ba157
commit f8fcab7929
21 changed files with 195 additions and 142 deletions

View File

@@ -265,7 +265,7 @@ export default class CBlock extends CRest {
if (global.LOAD_TO_BEGIN && this.BlockNumDBMin) {
this.SendLoadToBegin()
}
//var CountStopSend = 0;
var CountStopSend = 0;
var min_num = this.CurrentBlockNum - global.MAX_COUNT_CHAIN_LOAD;
var min_num_load = this.CurrentBlockNum;
for (var i = 0; i < this.LoadedChainList.length; i++) {
@@ -311,7 +311,7 @@ export default class CBlock extends CRest {
}
}
if (chain && chain.StopSend) {
//CountStopSend++
CountStopSend++
}
chain = this.LoadedChainList[i]
if (chain && !chain.GetFindDB() && !chain.StopSend) {
@@ -534,7 +534,7 @@ export default class CBlock extends CRest {
chain.BlockHead = Block
if (!chain.BlockNumMax)
chain.BlockNumMax = Block.BlockNum
//var PrevBlock0 = PrevBlock;
var PrevBlock0 = PrevBlock;
if (BlockFind) {
if (PrevBlock) {
PrevBlock.BlockDown = BlockFind
@@ -673,9 +673,9 @@ export default class CBlock extends CRest {
for (var num = 0; num < this.LoadedChainList.length; num++) {
var chain = this.LoadedChainList[num];
if (chain && chain.arr && chain.arr.length && chain.StopSend) {
//var Count = 0;
var Count = 0;
for (var i = chain.CurNumArrLoad; i < chain.arr.length; i++) {
//Count++
Count++
var Block = chain.arr[i];
if (!global.IsZeroArr(Block.TreeHash) && !Block.TreeEq && !Block.LoadDBFinaly) {
if (!Block.MapSend) {
@@ -702,7 +702,7 @@ export default class CBlock extends CRest {
if (i === chain.CurNumArrLoad) {
chain.CurNumArrLoad++
Block.LoadDBFinaly = true
//Count = 0
Count = 0
}
}
}
@@ -1042,7 +1042,7 @@ export default class CBlock extends CRest {
return "{BlockNum:uint}";
}
CANBLOCK(Info, CurTime) {
// var Data = this.DataFromF(Info);
var Data = this.DataFromF(Info);
this.SendF(Info.Node, { "Method": "RETCANBLOCK", "Data": { Result: 1 } })
}
static RETCANBLOCK_F() {
@@ -1159,10 +1159,10 @@ export default class CBlock extends CRest {
this.FREE_MEM_BLOCKS(NumMax - global.BLOCK_COUNT_IN_MEMORY)
var maxArrMap = Math.floor(NumMax / global.BLOCK_COUNT_IN_MEMORY) - 1;
if (maxArrMap >= 0) {
// var nWasCount = 0;
var nWasCount = 0;
for (var key in this.MapMapLoaded)
if (key as any < maxArrMap) {
// nWasCount++
nWasCount++
delete this.MapMapLoaded[key]
}
}