1
0
forked from circlecloud/tera

fix: method refactor error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-07-10 17:28:08 +08:00
parent 87a863a228
commit 812813da8d
21 changed files with 92 additions and 111 deletions

View File

@@ -51,7 +51,7 @@ module.exports = class CConsensus extends require("./block-loader")
this.CurrentBlockNum = 0
this.SendBlockID = 0
this.RelayMode = false
this.TreeSendPacket = new RBTree(global.CompareItemHash)
this.TreeSendPacket = new global.RBTree(global.CompareItemHash)
if (!global.ADDRLIST_MODE && !this.VirtualMode) {
this.idBlockChainTimer = setInterval(this.StartBlockChain.bind(this), global.CONSENSUS_PERIOD_TIME - 5)
setInterval(this.DoTransfer.bind(this), global.CONSENSUS_CHECK_TIME)
@@ -85,8 +85,8 @@ module.exports = class CConsensus extends require("./block-loader")
Context.TransferFromAddr = {}
Context.LevelsTransfer = []
Context.ErrRun = ""
Context.PowTxTree = new RBTree(global.CompareItemTimePow)
Context.PowTicketTree = new RBTree(global.CompareItemTimePow)
Context.PowTxTree = new global.RBTree(global.CompareItemTimePow)
Context.PowTicketTree = new global.RBTree(global.CompareItemTimePow)
Context.bSave = false
Context.PrevHash = undefined
Context.TreeHash = undefined
@@ -692,7 +692,7 @@ module.exports = class CConsensus extends require("./block-loader")
}
AddPOWToMaxTree(POW, item) {
if (!POW.MaxTree) {
POW.MaxTree = new RBTree(function(a, b) {
POW.MaxTree = new global.RBTree(function(a, b) {
return global.CompareArr(a.PowHash, b.PowHash);
})
}
@@ -1367,8 +1367,7 @@ module.exports = class CConsensus extends require("./block-loader")
}
}
};
let STreeBuffer = global.STreeBuffer;
global.TreeBlockBuf = new STreeBuffer(50 * 1000, global.CompareItemHashSimple, "string");
global.TreeBlockBuf = new global.STreeBuffer(50 * 1000, global.CompareItemHashSimple, "string");
var PrevTimeIdle = 0;
OnTimeIdle();