Mon Aug 19 14:00:17 CST 2019 Source Update...

This commit is contained in:
2019-08-19 14:00:17 +08:00
parent ea0bd38cae
commit 32b99633aa
26 changed files with 424 additions and 474 deletions

View File

@@ -33,6 +33,8 @@ WebApi2.CreateAccount = function (Params,response)
Meta:Params.Meta, };
var Str = JSON.stringify(Result);
response.end(Str);
if(typeof Params.F === "function")
Params.F(Result);
});
return null;
}
@@ -45,7 +47,7 @@ WebApi2.Send = function (Params,response,A,bJsonRet)
return {result:0};
var Coin;
if(typeof Params.Amount === "number")
Coin = COIN_FROM_FLOAT(Params.Amount);
Coin = COIN_FROM_FLOAT2(Params.Amount);
else
Coin = Params.Amount;
var FromNum = ParseNum(Params.FromID);
@@ -96,6 +98,8 @@ WebApi2.Send = function (Params,response,A,bJsonRet)
Meta:Params.Meta, };
var Str = JSON.stringify(Result);
response.end(Str);
if(typeof Params.F === "function")
Params.F(Result);
});
return null;
};

View File

@@ -147,8 +147,8 @@ function AddTransactionFromWeb(Params)
return text;
};
global.AddTransactionFromWeb = AddTransactionFromWeb;
global.STATIC_PROCESS = {Name:"STATIC PROCESS", idInterval:0, idInterval1:0, idInterval2:0, LastAlive:Date.now(), Worker:undefined,
Path:"./process/static-process.js", OnMessage:OnMessageStatic, PeriodAlive:50000};
global.STATIC_PROCESS = {Name:"STATIC PROCESS", NodeOnly:1, idInterval:0, idInterval1:0, idInterval2:0, LastAlive:Date.now(),
Worker:undefined, Path:"./process/static-process.js", OnMessage:OnMessageStatic, PeriodAlive:50000};
ArrChildProcess.push(STATIC_PROCESS);
function OnMessageStatic(msg)
@@ -167,7 +167,7 @@ function OnMessageStatic(msg)
}
}
};
global.TX_PROCESS = {Name:"TX PROCESS", idInterval:0, idInterval1:0, idInterval2:0, LastAlive:Date.now(), Worker:undefined,
global.TX_PROCESS = {Name:"TX PROCESS", NodeOnly:1, idInterval:0, idInterval1:0, idInterval2:0, LastAlive:Date.now(), Worker:undefined,
Path:"./process/tx-process.js", OnMessage:OnMessageTX, PeriodAlive:100 * 1000};
ArrChildProcess.push(TX_PROCESS);
@@ -211,6 +211,10 @@ var GlobalRunMap = {};
function StartChildProcess(Item)
{
if(Item.NodeOnly && global.NET_WORK_MODE && NET_WORK_MODE.NOT_RUN)
{
return ;
}
let ITEM = Item;
ITEM.idInterval = setInterval(function ()
{
@@ -732,7 +736,10 @@ function Fork(Path,ArrArgs)
const child_process = require('child_process');
ArrArgs = ArrArgs || [];
if(global.LOCAL_RUN)
{
ArrArgs.push("LOCALRUN");
ArrArgs.push("STARTNETWORK:" + global.START_NETWORK_DATE);
}
else
if(global.TEST_NETWORK)
ArrArgs.push("TESTRUN");

View File

@@ -75,7 +75,7 @@ function DoTXProcess()
if(bShowDetail)
ToLog("BlockMin: " + BlockMin.BlockNum + " LastBlockNum=" + LastBlockNum);
var CountTX = 0;
for(var Num = BlockMin.BlockNum; Num < BlockMin.BlockNum + 200; Num++)
for(var Num = BlockMin.BlockNum; Num < BlockMin.BlockNum + 1000; Num++)
{
var EndTime = Date.now();
var Delta = EndTime - StartTime;

View File

@@ -833,6 +833,8 @@ HostingCaller.GetHistoryTransactions = function (Params)
};
HostingCaller.GetSupply = function (Params)
{
if(HTTPS_HOSTING_DOMAIN === "terafoundation.org")
return "" + (1000000000 - 411 * 1000000);
var Data = DApps.Accounts.ReadState(0);
if(!Data)
return "";
@@ -898,3 +900,10 @@ global.LoadBlockFromNetwork = function (Params,F)
F(Err, Block);
});
};
if(global.LOCAL_RUN)
{
setTimeout(function ()
{
require("../UnitTest/new-tx.js");
}, 1000);
}