1
0
forked from circlecloud/tera

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

@@ -91,17 +91,18 @@ process.on('error' as any, function(err: TeraError) {
});
global.HTTP_PORT_NUMBER = 0;
import CServerDB from '../core/transaction-validator'
import { STreeBuffer } from '../core/base';
var KeyPair = crypto.createECDH('secp256k1');
KeyPair.setPrivateKey(Buffer.from([77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77]));
global.SERVER = new CServerDB(KeyPair, undefined, undefined, false, true);
global.TreeFindTX = new global.STreeBuffer(30 * 1000, global.CompareItemHashSimple, "string");
global.TreeFindTX = new STreeBuffer(30 * 1000, global.CompareItemHashSimple, "string");
setInterval(function() {
if (global.SERVER) {
global.SERVER.Close();
}
DoTXProcess();
}, 10);
var BlockTree = new global.STreeBuffer(30 * 1000, global.CompareItemHashSimple, "number");
var BlockTree = new STreeBuffer(30 * 1000, global.CompareItemHashSimple, "number");
global.bShowDetail = 0;
var StopTxProcess = 0;
var MinimalValidBlock = 0;