Browse Source

Build 1.0.9

Correction of BUG-101
PascalCoin 8 years ago
parent
commit
a2293f9d2a

+ 2 - 2
COMPILE_INSTRUCTIONS.txt

@@ -3,7 +3,7 @@
 *********************************
 *********************************
 (File updated 2016-10-20)
 (File updated 2016-10-20)
 
 
-Instruction about how to compile Pascal Coin Wallet 1.0.8  (2016-10-20)
+Instruction about how to compile Pascal Coin Wallet 1.0.9  (2016-10-21)
 For newer versions... I hope will be similar ;-)
 For newer versions... I hope will be similar ;-)
 
 
 IMPORTANT NOTE:
 IMPORTANT NOTE:
@@ -23,7 +23,7 @@ PLEASE READ CAREFULLY:
 
 
 - Create a source code folder, we will call this folder "SOURCE_CODE_FOLDER" 
 - Create a source code folder, we will call this folder "SOURCE_CODE_FOLDER" 
 
 
-- Download PascalCoin source code from: https://github.com/PascalCoin/PascalCoin  (Tested with Build 1.0.8)
+- Download PascalCoin source code from: https://github.com/PascalCoin/PascalCoin  (Tested with Build 1.0.9)
 - Download Synapse source code from: http://www.ararat.cz/synapse/lib/exe/fetch.php/file:synapse40.zip  (Tested with version Synapse40)
 - Download Synapse source code from: http://www.ararat.cz/synapse/lib/exe/fetch.php/file:synapse40.zip  (Tested with version Synapse40)
   - Also you can download a new version from svn: https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/
   - Also you can download a new version from svn: https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/
   - If URL is broken, try searching "Synapse ararat" at Google and Download
   - If URL is broken, try searching "Synapse ararat" at Google and Download

+ 9 - 3
README.md

@@ -20,12 +20,12 @@ https://github.com/PascalCoin/PascalCoin
 
 
 HOW TO COMPILE:
 HOW TO COMPILE:
 
 
-Version 1.0.8 of Pascal Coin Wallet can be compiled with Delphi and Lazarus and run in Windows or Linux
+Version 1.0.9 of Pascal Coin Wallet can be compiled with Delphi and Lazarus and run in Windows or Linux
 
 
 - Included source code available at https://github.com/PascalCoin/PascalCoin
 - Included source code available at https://github.com/PascalCoin/PascalCoin
-- Read "COMPILE_INSTRUCTIONS" file with instructions (available at github)
+- Read "COMPILE_INSTRUCTIONS" file with instructions
 
 
-To run it needs a OpenSSL library:
+To run:
 - Windows: libeay32.dll - Can be downloaded from https://indy.fulgan.com/SSL/
 - Windows: libeay32.dll - Can be downloaded from https://indy.fulgan.com/SSL/
 - Linux: libcrypto.so.1.0.0 or libcrypto.so.1.1 (Instructions in "COMPILE_INSTRUCTIONS" file)
 - Linux: libcrypto.so.1.0.0 or libcrypto.so.1.1 (Instructions in "COMPILE_INSTRUCTIONS" file)
 
 
@@ -37,6 +37,12 @@ If you like it, consider a donation using BitCoin:
 
 
 History:
 History:
 
 
+Build 1.0.9.0 - 2016-10-21
+--------------------------
+- Corrected a BUG (BUG-101) that causes blocking connections when received more than 100 connections, causing "alone in the world" after a cert period time.
+- It's necessary to update because new version will refuse old versions to make network stable.
+
+
 Build 1.0.8.0 - 2016-10-20
 Build 1.0.8.0 - 2016-10-20
 --------------------------
 --------------------------
 - Cross compatible
 - Cross compatible

+ 9 - 3
README.txt

@@ -20,12 +20,12 @@ https://github.com/PascalCoin/PascalCoin
 
 
 HOW TO COMPILE:
 HOW TO COMPILE:
 
 
-Version 1.0.8 of Pascal Coin Wallet can be compiled with Delphi and Lazarus and run in Windows or Linux
+Version 1.0.9 of Pascal Coin Wallet can be compiled with Delphi and Lazarus and run in Windows or Linux
 
 
 - Included source code available at https://github.com/PascalCoin/PascalCoin
 - Included source code available at https://github.com/PascalCoin/PascalCoin
-- Read "COMPILE_INSTRUCTIONS" file with instructions (available at github)
+- Read "COMPILE_INSTRUCTIONS" file with instructions
 
 
-To run it needs a OpenSSL library:
+To run:
 - Windows: libeay32.dll - Can be downloaded from https://indy.fulgan.com/SSL/
 - Windows: libeay32.dll - Can be downloaded from https://indy.fulgan.com/SSL/
 - Linux: libcrypto.so.1.0.0 or libcrypto.so.1.1 (Instructions in "COMPILE_INSTRUCTIONS" file)
 - Linux: libcrypto.so.1.0.0 or libcrypto.so.1.1 (Instructions in "COMPILE_INSTRUCTIONS" file)
 
 
@@ -37,6 +37,12 @@ If you like it, consider a donation using BitCoin:
 
 
 History:
 History:
 
 
+Build 1.0.9.0 - 2016-10-21
+--------------------------
+- Corrected a BUG (BUG-101) that causes blocking connections when received more than 100 connections, causing "alone in the world" after a cert period time.
+- It's necessary to update because new version will refuse old versions to make network stable.
+
+
 Build 1.0.8.0 - 2016-10-20
 Build 1.0.8.0 - 2016-10-20
 --------------------------
 --------------------------
 - Cross compatible
 - Cross compatible

+ 1 - 1
Units/PascalCoin/UConst.pas

@@ -101,7 +101,7 @@ Const
   CT_Op_Changekey = $02;
   CT_Op_Changekey = $02;
   CT_Op_Recover = $03;
   CT_Op_Recover = $03;
 
 
-  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'1.0.8'{$ELSE}{$IFDEF TESTNET}'TESTNET'{$ELSE}{$ENDIF}{$ENDIF};
+  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'1.0.9'{$ELSE}{$IFDEF TESTNET}'TESTNET'{$ELSE}{$ENDIF}{$ENDIF};
 
 
   CT_Discover_IPs =  'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.ddns.net;pascalcoin2.ddns.net;pascalcoin1.dynamic-dns.net;pascalcoin1.dns1.us';
   CT_Discover_IPs =  'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.ddns.net;pascalcoin2.ddns.net;pascalcoin1.dynamic-dns.net;pascalcoin1.dns1.us';
 
 

+ 18 - 3
Units/PascalCoin/UNetProtocol.pas

@@ -2516,7 +2516,10 @@ begin
         data.Write(nsa.last_connection,4);
         data.Write(nsa.last_connection,4);
       end;
       end;
       // Send client version
       // Send client version
-      TStreamOp.WriteAnsiString(data,CT_ClientAppVersion{$IFDEF LINUX}+'l'{$ELSE}+'w'{$IFDEF Synapse}+'s'{$ENDIF}{$ENDIF}{$IFDEF OpenSSL10}+'0'{$ELSE}+'1'{$ENDIF});
+// XXXXXXXXXXXXX
+//      TStreamOp.WriteAnsiString(data,CT_ClientAppVersion{$IFDEF LINUX}+'l'{$ELSE}+'w'{$IFDEF Synapse}+'s'{$ENDIF}{$ENDIF}{$IFDEF OpenSSL10}+'0'{$ELSE}+'1'{$ENDIF});
+      TStreamOp.WriteAnsiString(data,CT_ClientAppVersion{$IFDEF LINUX}+'l'{$ELSE}+'w'{$ENDIF});
+// XXXXXXXXXXXXX
     finally
     finally
       op.free;
       op.free;
     end;
     end;
@@ -2751,6 +2754,8 @@ Var l : TList;
   i, nactive,ndeleted,ntotal,nserverclients : Integer;
   i, nactive,ndeleted,ntotal,nserverclients : Integer;
   netconn : TNetConnection;
   netconn : TNetConnection;
   netserverclientstop : TNetServerClient;
   netserverclientstop : TNetServerClient;
+  aux : AnsiString;
+  needother : Boolean;
 begin
 begin
   FLastCheckTS := GetTickCount;
   FLastCheckTS := GetTickCount;
   while (Not Terminated) do begin
   while (Not Terminated) do begin
@@ -2760,6 +2765,7 @@ begin
       ntotal := 0;
       ntotal := 0;
       nserverclients := 0;
       nserverclients := 0;
       netserverclientstop := Nil;
       netserverclientstop := Nil;
+      needother := true;
       FLastCheckTS := GetTickCount;
       FLastCheckTS := GetTickCount;
       l := FNetData.FNetConnections.LockList;
       l := FNetData.FNetConnections.LockList;
       try
       try
@@ -2775,9 +2781,18 @@ begin
           end else if (netconn is TNetServerClient) then begin
           end else if (netconn is TNetServerClient) then begin
             inc(nserverclients);
             inc(nserverclients);
             if (Not netconn.FDoFinalizeConnection) then begin
             if (Not netconn.FDoFinalizeConnection) then begin
-              if not assigned(netserverclientstop) then netserverclientstop := TNetServerClient(netconn)
-              else if netconn.CreatedTime<netserverclientstop.CreatedTime then begin
+              // Build 1.0.9 BUG-101 Only disconnect old versions prior to 1.0.9
+              if not assigned(netserverclientstop) then begin
                 netserverclientstop := TNetServerClient(netconn);
                 netserverclientstop := TNetServerClient(netconn);
+                aux := Copy(netconn.FClientAppVersion,1,5);
+                needother := Not ((aux='1.0.6') or (aux='1.0.7') or (aux='1.0.8'));
+              end else begin
+                aux := Copy(netconn.FClientAppVersion,1,5);
+                if ((aux='1.0.6') or (aux='1.0.7') or (aux='1.0.8'))
+                  And ((needother) Or (netconn.CreatedTime<netserverclientstop.CreatedTime)) then begin
+                  needother := false;
+                  netserverclientstop := TNetServerClient(netconn);
+                end;
               end;
               end;
             end;
             end;
           end;
           end;

+ 8 - 1
Units/PascalCoin/UThread.pas

@@ -91,7 +91,14 @@ begin
     TLog.NewLog(ltdebug,Classname,'Starting Thread');
     TLog.NewLog(ltdebug,Classname,'Starting Thread');
     Try
     Try
       Try
       Try
-        BCExecute;
+        Try
+          BCExecute;
+          FDebugStep := 'Finalized BCExecute';
+        Finally
+          // Build 1.0.9 BUG-101 When BCExecute ends... must indicate to Thread Terminated=TRUE !
+          // ... because if not... nobody knows when a thread terminated !
+          Terminate;
+        End;
       Except
       Except
         On E:Exception do begin
         On E:Exception do begin
           TLog.NewLog(lterror,Classname,'Exception inside a Thread at step: '+FDebugStep+' ('+E.ClassName+'): '+E.Message);
           TLog.NewLog(lterror,Classname,'Exception inside a Thread at step: '+FDebugStep+' ('+E.ClassName+'): '+E.Message);