From 8576359edcd855c405cc1a40651d17cd358643bc Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Sat, 13 Jul 2019 15:10:19 +0800 Subject: [PATCH] refactor: sync db Signed-off-by: MiaoWoo --- src/core/db/block-db.ts | 8 ++++---- src/core/db/db.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/db/block-db.ts b/src/core/db/block-db.ts index 3a0e2ba..644991a 100644 --- a/src/core/db/block-db.ts +++ b/src/core/db/block-db.ts @@ -10,10 +10,9 @@ "use strict"; import * as fs from 'fs' -import Db from './db' +import DBLib from './db' import DBRow from './db-row' -import CCode from '../code' -global.BlockDB = new Db(); +global.BlockDB = new DBLib(); global.BLOCK_HEADER_SIZE = 150; const FILE_NAME_HEADER = "block-header"; const FILE_NAME_BODY = "block-body"; @@ -34,6 +33,7 @@ const FORMAT_HEADER_VERSION2 = "{FilePos:uint}"; const FILE_NAME_HEADER2 = "block-header2"; const WorkStructHeader2 = {}; const DEFAULT_DB_VERSION = 2; +import CCode from '../code' export default class CDB extends CCode { DBHeader100 BlockNumDB @@ -667,7 +667,7 @@ export default class CDB extends CCode { Block.Miner = global.ReadUintFromArr(Block.AddrHash, 0) if (Block.BlockNum < 16 || Block.Miner > MaxAccount) Block.Miner = 0 - if (bMinerName && Block.Miner) { + if (bMinerName) { Block.MinerName = "" if (Block.Miner) { var Item = global.DApps.Accounts.ReadState(Block.Miner); diff --git a/src/core/db/db.ts b/src/core/db/db.ts index 8039415..3eb238f 100644 --- a/src/core/db/db.ts +++ b/src/core/db/db.ts @@ -98,7 +98,7 @@ function CheckStartOneProcess(Name) { BlockDB.OpenDBFile(Name); } catch (e) { global.ToLog("****** DETECT START ANOTHER PROCESS for: " + Name); - global.ToLogTrace("EXIT"); + global.ToLogTrace("EXIT Err " + e); process.exit(); } };