refactor: replace global new

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-07-13 10:22:28 +08:00
parent 5fd017eaf1
commit efb60e3d0d
7 changed files with 20 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ import * as fs from 'fs'
import CRest from './rest-loader'
import { TYPE_TRANSACTION } from '../constant/account';
import { STreeBuffer } from './base';
import { RBTree } from './library';
//import * as crypto from 'crypto';
require('./block-loader-const');
const STAT_BLOCK_LOAD_PERIOD = global.CONSENSUS_PERIOD_TIME / 5;
@@ -1197,7 +1198,7 @@ export default class CBlock extends CRest {
GetHistoryTree(typedata) {
var Tree = global.HistoryBlockBuf.LoadValue(typedata, 1);
if (!Tree) {
Tree = new global.RBTree(global.CompareItemHash)
Tree = new RBTree(global.CompareItemHash)
global.HistoryBlockBuf.SaveValue(typedata, Tree)
}
return Tree;