2
0
Эх сурвалжийг харах

Merge branch 'master' into Releases/4.0.3

PascalCoin 6 жил өмнө
parent
commit
bbb3cfdf88

+ 1 - 1
PIP/PIP-0030.md

@@ -26,7 +26,7 @@ To improve this, first consider that how PascalCoin works. Users own accounts (P
 
 
 It is proposed by this PIP to change the SafeBoxHash algorithm to be a **merkle-root of the Account Segments**.This is to be called the SafeBoxRoot and marked SR in below diagram.
 It is proposed by this PIP to change the SafeBoxHash algorithm to be a **merkle-root of the Account Segments**.This is to be called the SafeBoxRoot and marked SR in below diagram.
 
 
-![PASA Seals](resources/PIP-0030/SafeBoxRoot-Diagram.png)
+![PASA Seals](resources/PIP-0030/SafeBoxRoot-Diagram.drawio.png)
 
 
 By changing the SafeBoxHash to be the SafeBoxRoot, it becomes possible for light-clients to cryptographically prove the validity of an Account Segment **without** the SafeBox. The benefits of this capability include:
 By changing the SafeBoxHash to be the SafeBoxRoot, it becomes possible for light-clients to cryptographically prove the validity of an Account Segment **without** the SafeBox. The benefits of this capability include:
 
 

BIN
PIP/resources/PIP-0030/SafeBoxRoot-Diagram.drawio.jpg


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Diagram.drawio.png


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
PIP/resources/PIP-0030/SafeBoxRoot-Diagram.drawio.xml


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Diagram.jpg


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Diagram.png


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Example-Proof-1.drawio.jpg


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Example-Proof-1.drawio.png


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
PIP/resources/PIP-0030/SafeBoxRoot-Example-Proof-1.drawio.xml


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Example-Proof-2.drawio.jpg


BIN
PIP/resources/PIP-0030/SafeBoxRoot-Example-Proof-2.drawio.png


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
PIP/resources/PIP-0030/SafeBoxRoot-Example-Proof-2.drawio.xml


+ 8 - 1
src/core/URPC.pas

@@ -27,7 +27,10 @@ interface
 Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain,
 Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain,
   UNetProtocol, UOpTransaction, UWallet, UTime, UPCEncryption, UTxMultiOperation,
   UNetProtocol, UOpTransaction, UWallet, UTime, UPCEncryption, UTxMultiOperation,
   UJSONFunctions, classes, blcksock, synsock,
   UJSONFunctions, classes, blcksock, synsock,
-  IniFiles, Variants, math, UBaseTypes, UOpenSSL,
+  IniFiles, Variants, math, UBaseTypes,
+  {$IFDEF Use_OpenSSL}
+  UOpenSSL,
+  {$ENDIF}
   UPCOrderedLists, UPCDataTypes,
   UPCOrderedLists, UPCDataTypes,
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   UNetProtection;
   UNetProtection;
@@ -940,6 +943,7 @@ function TRPCProcess.ProcessMethod(const method: String; params: TPCJSONObject;
 
 
   Function CheckAndGetEncodedRAWPayload(Const RawPayload : TRawBytes; Const Payload_method, EncodePwdForAES : String; const senderAccounKey, targetAccountKey : TAccountKey; var EncodedRAWPayload : TRawBytes) : Boolean;
   Function CheckAndGetEncodedRAWPayload(Const RawPayload : TRawBytes; Const Payload_method, EncodePwdForAES : String; const senderAccounKey, targetAccountKey : TAccountKey; var EncodedRAWPayload : TRawBytes) : Boolean;
   begin
   begin
+    Result := False;
     if (length(RawPayload)>0) then begin
     if (length(RawPayload)>0) then begin
       if (Payload_method='none') then EncodedRAWPayload:=RawPayload
       if (Payload_method='none') then EncodedRAWPayload:=RawPayload
       else if (Payload_method='dest') then begin
       else if (Payload_method='dest') then begin
@@ -954,6 +958,7 @@ function TRPCProcess.ProcessMethod(const method: String; params: TPCJSONObject;
         exit;
         exit;
       end;
       end;
     end else EncodedRAWPayload := Nil;
     end else EncodedRAWPayload := Nil;
+    Result := True;
   end;
   end;
 
 
   // This function creates a TOpTransaction without looking for balance/private key of sender account
   // This function creates a TOpTransaction without looking for balance/private key of sender account
@@ -3426,7 +3431,9 @@ begin
     GetResultObject.GetAsObject('netstats').GetAsVariant('tservers').Value:=TNetData.NetData.NetStatistics.TotalServersConnections;
     GetResultObject.GetAsObject('netstats').GetAsVariant('tservers').Value:=TNetData.NetData.NetStatistics.TotalServersConnections;
     GetResultObject.GetAsObject('netstats').GetAsVariant('breceived').Value:=TNetData.NetData.NetStatistics.BytesReceived;
     GetResultObject.GetAsObject('netstats').GetAsVariant('breceived').Value:=TNetData.NetData.NetStatistics.BytesReceived;
     GetResultObject.GetAsObject('netstats').GetAsVariant('bsend').Value:=TNetData.NetData.NetStatistics.BytesSend;
     GetResultObject.GetAsObject('netstats').GetAsVariant('bsend').Value:=TNetData.NetData.NetStatistics.BytesSend;
+    {$IFDEF Use_OpenSSL}
     GetResultObject.GetAsVariant('openssl').Value := IntToHex(OpenSSLVersion,8);
     GetResultObject.GetAsVariant('openssl').Value := IntToHex(OpenSSLVersion,8);
+    {$ENDIF}
     nsaarr := TNetData.NetData.NodeServersAddresses.GetValidNodeServers(true,20);
     nsaarr := TNetData.NetData.NodeServersAddresses.GetValidNodeServers(true,20);
     for i := low(nsaarr) to High(nsaarr) do begin
     for i := low(nsaarr) to High(nsaarr) do begin
       jso := GetResultObject.GetAsArray('nodeservers').GetAsObject(i);
       jso := GetResultObject.GetAsArray('nodeservers').GetAsObject(i);

+ 6 - 2
src/gui-classic/UFRMAbout.pas

@@ -63,7 +63,11 @@ uses
   ShellApi,
   ShellApi,
 {$ELSE}
 {$ELSE}
 {$ENDIF}
 {$ENDIF}
-  UFolderHelper, UConst, UNode, UOpenSSL;
+  UFolderHelper, UConst,
+{$IFDEF Use_OpenSSL}
+  UOpenSSL,
+{$ENDIF}
+  UNode;
 
 
 {$IFnDEF FPC}
 {$IFnDEF FPC}
   {$R *.dfm}
   {$R *.dfm}
@@ -73,7 +77,7 @@ uses
 
 
 procedure TFRMAbout.FormCreate(Sender: TObject);
 procedure TFRMAbout.FormCreate(Sender: TObject);
 begin
 begin
-  lblBuild.Caption :=  'Build: '+CT_ClientAppVersion+' OpenSSL: '+IntToHex(OpenSSLVersion,8)+' Compiler: '{$IFDEF FPC}+'FPC'{$IFDEF CPU32}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ELSE}+'Delphi'{$IFDEF CPU32BITS}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ENDIF};
+  lblBuild.Caption :=  'Build: '+CT_ClientAppVersion+' OpenSSL: '+{$IFDEF Use_OpenSSL}IntToHex(OpenSSLVersion,8){$ELSE}'NONE'{$ENDIF}+' Compiler: '{$IFDEF FPC}+'FPC'{$IFDEF CPU32}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ELSE}+'Delphi'{$IFDEF CPU32BITS}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ENDIF};
   lblProtocolVersion.Caption := Format('BlockChain Protocol: %d (%d)  -  Net Protocol: %d (%d)',[TNode.Node.Bank.SafeBox.CurrentProtocol,CT_BlockChain_Protocol_Available,
   lblProtocolVersion.Caption := Format('BlockChain Protocol: %d (%d)  -  Net Protocol: %d (%d)',[TNode.Node.Bank.SafeBox.CurrentProtocol,CT_BlockChain_Protocol_Available,
     CT_NetProtocol_Version, CT_NetProtocol_Available]);
     CT_NetProtocol_Version, CT_NetProtocol_Available]);
 end;
 end;

+ 7 - 1
src/gui-classic/UFRMWallet.pas

@@ -322,7 +322,11 @@ implementation
   {$R *.lfm}
   {$R *.lfm}
 {$ENDIF}
 {$ENDIF}
 
 
-Uses UFolderHelper, UOpenSSL, UTime, UFileStorage,
+Uses UFolderHelper,
+{$IFDEF Use_OpenSSL}
+  UOpenSSL,
+{$ENDIF}
+  UTime, UFileStorage,
   UThread, UOpTransaction, UFRMPascalCoinWalletConfig,
   UThread, UOpTransaction, UFRMPascalCoinWalletConfig,
   UFRMOperationsExplorer,
   UFRMOperationsExplorer,
   {$IFDEF TESTNET}
   {$IFDEF TESTNET}
@@ -405,7 +409,9 @@ begin
   FIsActivated := true;
   FIsActivated := true;
   try
   try
     // Check OpenSSL dll
     // Check OpenSSL dll
+{$IFDEF Use_OpenSSL}
     if Not LoadSSLCrypt then raise Exception.Create('Cannot load '+SSL_C_LIB+#10+'To use this software make sure this file is available on you system or reinstall the application');
     if Not LoadSSLCrypt then raise Exception.Create('Cannot load '+SSL_C_LIB+#10+'To use this software make sure this file is available on you system or reinstall the application');
+{$ENDIF}
     TCrypto.InitCrypto;
     TCrypto.InitCrypto;
     // Read Wallet
     // Read Wallet
     Try
     Try

+ 4 - 2
src/pascalcoin_wallet_classic.dpr

@@ -15,19 +15,21 @@ uses
   Forms,
   Forms,
   UAccountKeyStorage in 'core\UAccountKeyStorage.pas',
   UAccountKeyStorage in 'core\UAccountKeyStorage.pas',
   UAccounts in 'core\UAccounts.pas',
   UAccounts in 'core\UAccounts.pas',
+  {$IFDEF Use_OpenSSL}
   UAES in 'core\UAES.pas',
   UAES in 'core\UAES.pas',
+  UECIES in 'core\UECIES.pas',
+  UOpenSSL in 'core\UOpenSSL.pas',
+  {$ENDIF}
   UBaseTypes in 'core\UBaseTypes.pas',
   UBaseTypes in 'core\UBaseTypes.pas',
   UBlockChain in 'core\UBlockChain.pas',
   UBlockChain in 'core\UBlockChain.pas',
   UChunk in 'core\UChunk.pas',
   UChunk in 'core\UChunk.pas',
   UConst in 'core\UConst.pas',
   UConst in 'core\UConst.pas',
   UCrypto in 'core\UCrypto.pas',
   UCrypto in 'core\UCrypto.pas',
-  UECIES in 'core\UECIES.pas',
   UFileStorage in 'core\UFileStorage.pas',
   UFileStorage in 'core\UFileStorage.pas',
   ULog in 'core\ULog.pas',
   ULog in 'core\ULog.pas',
   UNetProtection in 'core\UNetProtection.pas',
   UNetProtection in 'core\UNetProtection.pas',
   UNetProtocol in 'core\UNetProtocol.pas',
   UNetProtocol in 'core\UNetProtocol.pas',
   UNode in 'core\UNode.pas',
   UNode in 'core\UNode.pas',
-  UOpenSSL in 'core\UOpenSSL.pas',
   UOpTransaction in 'core\UOpTransaction.pas',
   UOpTransaction in 'core\UOpTransaction.pas',
   UPoolMinerThreads in 'core\UPoolMinerThreads.pas',
   UPoolMinerThreads in 'core\UPoolMinerThreads.pas',
   UPoolMining in 'core\UPoolMining.pas',
   UPoolMining in 'core\UPoolMining.pas',

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно