Tue Sep 3 09:01:40 CST 2019 Source Update...

This commit is contained in:
2019-09-03 09:01:40 +08:00
parent 48fe258e2e
commit 228076945f
16 changed files with 1262 additions and 697 deletions

View File

@@ -8,7 +8,7 @@
* Telegram: https://t.me/terafoundation
*/
global.UPDATE_CODE_VERSION_NUM = 1194;
global.UPDATE_CODE_VERSION_NUM = 1213;
global.MIN_CODE_VERSION_NUM = 1114;
global.MINING_VERSION_NUM = 0;
global.InitParamsArg = InitParamsArg;
@@ -21,6 +21,7 @@ global.CONST_NAME_ARR = ["AUTO_CORRECT_TIME", "DELTA_CURRENT_TIME", "COMMON_KEY"
"HTTPS_HOSTING_DOMAIN", "HTTP_MAX_COUNT_ROWS", "HTTP_ADMIN_PASSWORD", "HTTP_START_PAGE", "WATCHDOG_BADACCOUNT", "RESYNC_CONDITION",
"MAX_CONNECTIONS_COUNT", "TRUST_PROCESS_COUNT", "REST_START_COUNT", "LOAD_TO_BEGIN", ];
global.UPDATE_CODE_1 = 36000000;
global.UPDATE_CODE_2 = 40000000;
global.MAX_LENGTH_SENDER_MAP = 3000;
global.DELTA_START_SENDER_MAP = 24;
global.NODES_DELTA_CALC_HOUR = 4;
@@ -171,6 +172,7 @@ if(global.LOCAL_RUN)
global.AUTO_CORRECT_TIME = 0;
global.CHECK_GLOBAL_TIME = 0;
global.UPDATE_CODE_1 = 0;
global.UPDATE_CODE_2 = 0;
}
else
if(global.TEST_NETWORK)
@@ -207,6 +209,7 @@ else
global.LOAD_TO_BEGIN = 2;
global.START_BAD_ACCOUNT_CONTROL = 3105000;
global.UPDATE_CODE_1 = 3180000;
global.UPDATE_CODE_2 = 4000000;
}
global.GetNetworkName = function ()
{

View File

@@ -332,6 +332,14 @@ function SendToResponceResult0(response)
var glBlock0;
HTTPCaller.DappStaticCall = function (Params,response)
{
var Result = RunStaticSmartMethod(ParseNum(Params.Account), Params.MethodName, Params.Params);
var Str = JSON.stringify(Result);
if(Str.length > 16000)
{
return {result:0, RetValue:"Error result length (more 16000)"};
}
response.end(Str);
return null;
DApps.Accounts.BeginBlock();
DApps.Accounts.BeginTransaction();
global.TickCounter = 100000;
@@ -345,7 +353,9 @@ HTTPCaller.DappStaticCall = function (Params,response)
var RetValue;
try
{
RetValue = RunSmartMethod(glBlock0, Account.Value.Smart, Account, 0, 0, undefined, Params.MethodName, Params.Params, 1);
var BlockNum = GetCurrentBlockNumByTime();
RetValue = RunSmartMethod(glBlock0, Account.Value.Smart, Account, BlockNum, 0, undefined, Params.MethodName, Params.Params,
1);
}
catch(e)
{
@@ -409,7 +419,6 @@ HTTPCaller.DappInfo = function (Params,responce,ObjectOnly)
{
Ret.CurTime = Date.now();
Ret.CurBlockNum = GetCurrentBlockNumByTime();
Ret.BlockNumDB = SERVER.BlockNumDB;
Ret.MaxAccID = DApps.Accounts.GetMaxAccount();
Ret.MaxDappsID = DApps.Smart.GetMaxNum();
}
@@ -1895,6 +1904,8 @@ function GetUserContext(Params)
if(!Context)
{
Context = {NumDappInfo:0, PrevDappInfo:"", NumAccountList:0, PrevAccountList:"", LastTime:0, FromEventNum:0};
Context.Session = Params.Session;
Context.Key = StrKey;
WebWalletUser[StrKey] = Context;
}
return Context;

View File

@@ -42,7 +42,7 @@ module.exports = class CRest extends require("./db/block-db")
return ;
}
this.LoadRestContext = {Mode:0, BlockNum:BlockNumRest, BlockNumRest:BlockNumRest, WasDelta:Delta, BlockNumProof:BlockNumRest + DELTA_BLOCK_ACCOUNT_HASH,
CountProof:COUNT_BLOCKS_FOR_LOAD, StartTimeHistory:Date.now(), MaxTimeOut:600 * 1000, LoopSyncRest:1, SendGetHeaderCount:0,
CountProof:COUNT_BLOCKS_FOR_LOAD, StartTimeHistory:Date.now(), MaxTimeOut:3600 * 1000, LoopSyncRest:1, SendGetHeaderCount:0,
ReceiveHeaderCount:0, ArrProof:[], MapSend:{}}
for(var i = 0; i < this.NodesArr.length; i++)
{