refactor: sync db
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
b8239f6da9
commit
8576359edc
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user