From addceb05221373bcf390990216503a855e7d4ad0 Mon Sep 17 00:00:00 2001 From: NosoDevTeam <142863157+NosoDevTeam@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:08:04 +0200 Subject: [PATCH] urgent update --- nl_data.pas | 15 +++++++++++++-- nl_network.pas | 9 ++++----- nosonosocfg.pas | 2 +- splashform.lfm | 3 ++- splashform.pas | 6 ++++++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/nl_data.pas b/nl_data.pas index cc0ed95..6e91dc3 100644 --- a/nl_data.pas +++ b/nl_data.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, IdTCPClient, dateutils, strutils, formlog,nosotime, - nosoconsensus,nosodebug; + nosoconsensus,nosodebug,nosonosocfg; Type @@ -294,6 +294,7 @@ procedure TUpdateThread.Execute; LLine : String = ''; ActualTime : int64; LastRefNodes : int64; + NewCFGData : string; Begin While not terminated do begin @@ -342,7 +343,7 @@ procedure TUpdateThread.Execute; FillArrayNodes; LastNodesUpdateTime := 0; end; - G_NosoCFGStr := GetNosoCFGFromNode; + //G_NosoCFGStr := GetNosoCFGFromNode; end; SumReceived := false; end; @@ -356,6 +357,16 @@ procedure TUpdateThread.Execute; RunUpdateGVTs(); end; end; + if Copy(GetCFGHash,1,5) <> Copy(GetConsensus(19),1,5) then + begin + //ToLog('main','CFG dont match'); + NewCFGData := GetNosoCFGFromNode; + if NewCFGData <> '' then + begin + SaveCFGToFile(NewCFGData); + FillArrayNodes; + end; + end; //} if GetConsensus(2){lastblock}.ToInteger=GetSumaryLastBlock then Wallet_Synced := true else Wallet_Synced := false; diff --git a/nl_network.pas b/nl_network.pas index 4cc07d7..65e1e4b 100644 --- a/nl_network.pas +++ b/nl_network.pas @@ -24,7 +24,7 @@ function SendOrder(OrderString:String):String; var Client : TidTCPClient; RanNode : integer; - ThisNode : NodeData; + ThisNode : String; TrysCount : integer = 0; WasOk : Boolean = false; Begin @@ -32,10 +32,9 @@ function SendOrder(OrderString:String):String; Client := TidTCPClient.Create(nil); REPEAT Inc(TrysCount); -RanNode := Random(length(ARRAY_Nodes)); -ThisNode := ARRAY_Nodes[RanNode]; -Client.Host:=ThisNode.host; -Client.Port:=thisnode.port; +ThisNode := GetRandonNode; +Client.Host := Parameter(ThisNode,0); +Client.Port := StrToIntDef(Parameter(ThisNode,1),8080); Client.ConnectTimeout:= 3000; Client.ReadTimeout:=3000; TRY diff --git a/nosonosocfg.pas b/nosonosocfg.pas index 70f058e..55a8c2c 100644 --- a/nosonosocfg.pas +++ b/nosonosocfg.pas @@ -40,7 +40,7 @@ interface LasTimeCFGRequest : int64 = 0; DefaultNosoCFG : String = // CFG parameters {0 Mainnet mode}'NORMAL '+ - {1 Seed nodes }'20.199.50.27;8080:107.173.210.55;8080:5.230.55.203;8080:141.11.192.215;8080:4.233.61.8;8080:84.247.143.153;8080:23.95.216.80;8080:64.69.43.225;8080:142.171.231.9;8080: '+ + {1 Seed nodes }'84.247.143.153;8080:173.212.222.226;8080:20.199.50.27;8080:4.233.61.8;8080: '+ {2 NTP servers }'ts2.aco.net:hora.roa.es:time.esa.int:time.stdtime.gov.tw:stratum-1.sjc02.svwh.net:ntp1.sp.se:1.de.pool.ntp.org:ntps1.pads.ufrj.br:utcnist2.colorado.edu:tick.usask.ca:ntp1.st.keio.ac.jp: '+ {3 DEPRECATED }'null: '+ {4 DEPRECATED }'null: '+ diff --git a/splashform.lfm b/splashform.lfm index f4bc97a..4d2f1cb 100644 --- a/splashform.lfm +++ b/splashform.lfm @@ -12,7 +12,7 @@ object Form4: TForm4 OnCreate = FormCreate Position = poScreenCenter ShowInTaskBar = stAlways - LCLVersion = '2.2.4.0' + LCLVersion = '3.0.0.3' Visible = True object Image1: TImage Left = 0 @@ -2159,5 +2159,6 @@ object Form4: TForm4 Font.Style = [fsBold] ParentColor = False ParentFont = False + OnClick = LabelSplashClick end end diff --git a/splashform.pas b/splashform.pas index cd17be9..b1910f2 100644 --- a/splashform.pas +++ b/splashform.pas @@ -18,6 +18,7 @@ TForm4 = class(TForm) Label2: TLabel; LabelSplash: TLabel; procedure FormCreate(Sender: TObject); + procedure LabelSplashClick(Sender: TObject); private public @@ -45,5 +46,10 @@ procedure TForm4.FormCreate(Sender: TObject); Label1.Caption:='Nosolite v'+ProgramVersion; end; +procedure TForm4.LabelSplashClick(Sender: TObject); +begin + +end; + END. // END UNIT