forked from circlecloud/tera
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";
|
"use strict";
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import Db from './db'
|
import DBLib from './db'
|
||||||
import DBRow from './db-row'
|
import DBRow from './db-row'
|
||||||
import CCode from '../code'
|
global.BlockDB = new DBLib();
|
||||||
global.BlockDB = new Db();
|
|
||||||
global.BLOCK_HEADER_SIZE = 150;
|
global.BLOCK_HEADER_SIZE = 150;
|
||||||
const FILE_NAME_HEADER = "block-header";
|
const FILE_NAME_HEADER = "block-header";
|
||||||
const FILE_NAME_BODY = "block-body";
|
const FILE_NAME_BODY = "block-body";
|
||||||
@ -34,6 +33,7 @@ const FORMAT_HEADER_VERSION2 = "{FilePos:uint}";
|
|||||||
const FILE_NAME_HEADER2 = "block-header2";
|
const FILE_NAME_HEADER2 = "block-header2";
|
||||||
const WorkStructHeader2 = {};
|
const WorkStructHeader2 = {};
|
||||||
const DEFAULT_DB_VERSION = 2;
|
const DEFAULT_DB_VERSION = 2;
|
||||||
|
import CCode from '../code'
|
||||||
export default class CDB extends CCode {
|
export default class CDB extends CCode {
|
||||||
DBHeader100
|
DBHeader100
|
||||||
BlockNumDB
|
BlockNumDB
|
||||||
@ -667,7 +667,7 @@ export default class CDB extends CCode {
|
|||||||
Block.Miner = global.ReadUintFromArr(Block.AddrHash, 0)
|
Block.Miner = global.ReadUintFromArr(Block.AddrHash, 0)
|
||||||
if (Block.BlockNum < 16 || Block.Miner > MaxAccount)
|
if (Block.BlockNum < 16 || Block.Miner > MaxAccount)
|
||||||
Block.Miner = 0
|
Block.Miner = 0
|
||||||
if (bMinerName && Block.Miner) {
|
if (bMinerName) {
|
||||||
Block.MinerName = ""
|
Block.MinerName = ""
|
||||||
if (Block.Miner) {
|
if (Block.Miner) {
|
||||||
var Item = global.DApps.Accounts.ReadState(Block.Miner);
|
var Item = global.DApps.Accounts.ReadState(Block.Miner);
|
||||||
|
@ -98,7 +98,7 @@ function CheckStartOneProcess(Name) {
|
|||||||
BlockDB.OpenDBFile(Name);
|
BlockDB.OpenDBFile(Name);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
global.ToLog("****** DETECT START ANOTHER PROCESS for: " + Name);
|
global.ToLog("****** DETECT START ANOTHER PROCESS for: " + Name);
|
||||||
global.ToLogTrace("EXIT");
|
global.ToLogTrace("EXIT Err " + e);
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user