fix: compaile error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-07-10 18:07:35 +08:00
parent f0d4952b27
commit 63536569cf
7 changed files with 34 additions and 40 deletions

View File

@@ -664,11 +664,11 @@ module.exports = class CDB extends require("../code")
Block.Hash2 = Value.Hash2
}
if (Filter) {
var Num = Block.BlockNum;
var Bytes = Block.TrDataLen;
var Pow = Block.Power;
var Miner = Block.Miner;
var Date = global.DateFromBlock(Block.BlockNum);
// var Num = Block.BlockNum;
// var Bytes = Block.TrDataLen;
// var Pow = Block.Power;
// var Miner = Block.Miner;
// var Date = global.DateFromBlock(Block.BlockNum);
try {
if (!eval(Filter))
continue;
@@ -828,7 +828,7 @@ module.exports = class CDB extends require("../code")
var ArrPowerMy = this.StatMap.ArrPowerMy;
var StartNumStat = this.StatMap.StartBlockNum;
var FinishNumStat = this.StatMap.StartBlockNum + this.StatMap.Length - 1;
var CountReadDB = 0;
// var CountReadDB = 0;
var arr = new Array(MinLength);
var arrmy = new Array(MinLength);
for (var num = start; num < finish; num++) {
@@ -839,7 +839,7 @@ module.exports = class CDB extends require("../code")
arrmy[i] = ArrPowerMy[i2]
}
else {
CountReadDB++
// CountReadDB++
var Power = 0, PowerMy = 0;
if (num <= MaxNumBlockDB) {
var Block = this.ReadBlockHeaderDB(num);
@@ -929,7 +929,7 @@ module.exports = class CDB extends require("../code")
BlockChainToBuf(WriteNum, StartNum, EndBlockNum) {
if (StartNum === undefined)
return global.BufLib.GetNewBuffer(10);
var GetLength = EndBlockNum - StartNum + 1;
// var GetLength = EndBlockNum - StartNum + 1;
var arr = [];
var arr0 = this.PrevBlockChainArr;
if (arr0 && arr0.length) {

View File

@@ -17,9 +17,9 @@ module.exports = class CDBState extends require("./db")
private DataSize;
private Format;
private WorkStruct;
private FileNameFull;
private LastHash;
private WasUpdate;
// private FileNameFull;
// private LastHash;
// private WasUpdate;
private BufMap;
private BufMapCount;
@@ -29,10 +29,10 @@ module.exports = class CDBState extends require("./db")
this.DataSize = DataSize
this.Format = Format
this.WorkStruct = {}
var FI = this.OpenDBFile(this.FileName, !bReadOnly);
this.FileNameFull = FI.fname
this.LastHash = undefined
this.WasUpdate = 1
// var FI = this.OpenDBFile(this.FileName, !bReadOnly);
// this.FileNameFull = FI.fname
// this.LastHash = undefined
// this.WasUpdate = 1
this.BufMap = {}
this.BufMapCount = 0
setInterval(this.CheckBufMap.bind(this), 1000)
@@ -48,8 +48,8 @@ module.exports = class CDBState extends require("./db")
}
Write(Data, RetBuf) {
var startTime = process.hrtime();
this.LastHash = undefined
this.WasUpdate = 1
// this.LastHash = undefined
// this.WasUpdate = 1
this.CheckNewNum(Data)
Data.Num = Math.trunc(Data.Num)
this.DeleteMap(Data.Num)
@@ -118,8 +118,8 @@ module.exports = class CDBState extends require("./db")
Position = 0
var FI = this.OpenDBFile(this.FileName, 1);
if (Position < FI.size) {
this.LastHash = undefined
this.WasUpdate = 1
// this.LastHash = undefined
// this.WasUpdate = 1
if (LastNum < 0)
global.ToLog("Truncate " + this.FileName + " from 0", 2)
FI.size = Position

View File

@@ -13,8 +13,8 @@ import * as fs from 'fs'
module.exports = class {
private DBMap;
private LastHash;
private WasUpdate;
// private LastHash;
// private WasUpdate;
private WasCheckPathDB;
constructor() {
@@ -25,8 +25,8 @@ module.exports = class {
global.CheckCreateDir(Path)
}
CloseDBFile(name, bdelete) {
this.LastHash = undefined
this.WasUpdate = 1
// this.LastHash = undefined
// this.WasUpdate = 1
var Item = this.DBMap[name];
if (Item) {
let bDelete = bdelete;
@@ -55,8 +55,8 @@ module.exports = class {
}
if (bWrite)
CheckStartOneProcess(name + "-run")
this.LastHash = undefined
this.WasUpdate = 1
// this.LastHash = undefined
// this.WasUpdate = 1
var Item = this.DBMap[name];
if (Item === undefined) {
if (!this.WasCheckPathDB) {