Selaa lähdekoodia

Set final changes to 5.7

PascalCoin 3 vuotta sitten
vanhempi
commit
6753de8425

+ 3 - 0
CHANGELOG.md

@@ -3,9 +3,12 @@
 ## Build 5.7 - PENDING
 - This version will not propagate 0-Fee operations, but will allow 0-Fee operations to the blockchain (CT_AllowPropagate0feeOperations=False)
   - A wallet that wants to execute 0-Fee operations will need to connect to a miner/pool/node running a 5.6 version or solomine
+- Removed "Ask for Account (PASA)" feature
+- Improved resend operations process
 - Improvements on TMemPool save to file to protect continued saving process
 - Improvements on TStorage to allow usage of AbstractMem library
 - AbstractMem library v1.6 with improvements on speed and allowing 64bits offsets for files +4Gb
+- Net protocol upgraded to 15, min compatible version 14 (Build 5.6)
 - Daemon:
   - Usage of Fast Memory Manager for FPC x86_64 on Linux as part of mORMot framework. Copyright (C) 2021 Arnaud Bouchez
   - log files separated by date: pascalcoin.log -> pascalcoin_YYYY-MM-DD.log

+ 3 - 3
src/core/UBlockChain.pas

@@ -3397,13 +3397,13 @@ function TStorage.DoGetAccountOperations(AAccount, AMaxDepth, AStartOperation,
     acc_0_miner_reward, acc_4_dev_reward : Int64;
     acc_4_for_dev : Boolean;
   begin
-    if (act_depth<=0) then exit;
+    if (act_depth=0) then exit;
     opc := TPCOperationsComp.Create(Nil);
     Try
       LAccounts := TList<Cardinal>.Create;
       try
         last_block_number := block_number+1;
-        while (last_block_number>block_number) And (act_depth>0)
+        while (last_block_number>block_number) And (act_depth<>0)
           And (block_number >= (AAccount DIV CT_AccountsPerBlock))
           And (AMaxOperations<>0)
           do begin
@@ -3486,7 +3486,7 @@ Var acc : TAccount;
   lastBalance : Int64;
 begin
   Result := False;
-  if AMaxDepth<0 then Exit;
+  if AMaxDepth=0 then Exit;
   if AAccount>=Bank.SafeBox.AccountsCount then Exit;
   if AMaxOperations=0 then Exit;
   Result := True;

+ 2 - 2
src/core/UConst.pas

@@ -132,10 +132,10 @@ Const
 
   CT_MagicNetIdentification = {$IFDEF PRODUCTION}$0A043580{$ELSE}$05000005{$ENDIF};
 
-  CT_NetProtocol_Version: Word = 12;
+  CT_NetProtocol_Version: Word = 14;
   // IMPORTANT NOTE!!!
   // NetProtocol_Available MUST BE always >= NetProtocol_version
-  CT_NetProtocol_Available: Word = {$IFDEF PRODUCTION}14{$ELSE}14{$ENDIF};
+  CT_NetProtocol_Available: Word = {$IFDEF PRODUCTION}15{$ELSE}15{$ENDIF};
 
   CT_MaxAccountOperationsPerBlockWithoutFee = 1;
   CT_AllowPropagate0feeOperations = False;

+ 12 - 2
src/gui-classic/UFRMOperation.pas

@@ -195,7 +195,7 @@ implementation
 
 uses
   {$IFDEF USE_GNUGETTEXT}gnugettext,{$ENDIF}UConst, UOpTransaction, UFRMNewPrivateKeyType, UFRMWalletKeys, UFRMHashLock,
-  UCommon, ULog, UGUIUtils;
+  UCommon, ULog, UGUIUtils, USettings;
 
 {$IFnDEF FPC}
   {$R *.dfm}
@@ -907,9 +907,19 @@ begin
     Result := TAccountComp.TxtToMoney(Trim(ebFee.Text),Fee);
     if not Result then errors := 'Invalid fee value "'+ebFee.Text+'"';
   end else begin
-    Fee := 0;
+    Fee := TSettings.DefaultFee;
     Result := true;
   end;
+  if (Fee<0) then begin
+    Result := False;
+    errors := 'Invalid fee value "'+ebFee.Text+'"';
+    ebFee.Text := TAccountComp.FormatMoney(TSettings.DefaultFee);
+  end;
+  if (Fee=0) and (Not CT_AllowPropagate0feeOperations) then begin
+    Result := False;
+    errors := '0 fee not allowed';
+    ebFee.Text := TAccountComp.FormatMoney(TSettings.DefaultFee);
+  end;
 end;
 
 procedure TFRMOperation.updateInfoClick(Sender: TObject);

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

@@ -115,9 +115,13 @@ begin
   if udInternetServerPort.Position = udJSONRPCMinerServerPort.Position then raise Exception.Create('Server port and JSON-RPC Server miner port are equal!');
 
   if TAccountComp.TxtToMoney(ebDefaultFee.Text,df) then begin
+    if (df<=0) And (Not CT_AllowPropagate0feeOperations) then begin
+      ebDefaultFee.Text := TAccountComp.FormatMoney(AppParams.ParamByName[CT_PARAM_DefaultFee].GetAsInteger(1));
+      raise Exception.Create('Minimum fee is at least '+TAccountComp.FormatMoney(CT_MOLINA));
+    end;
     AppParams.ParamByName[CT_PARAM_DefaultFee].SetAsInt64(df);
   end else begin
-    ebDefaultFee.Text := TAccountComp.FormatMoney(AppParams.ParamByName[CT_PARAM_DefaultFee].GetAsInteger(0));
+    ebDefaultFee.Text := TAccountComp.FormatMoney(AppParams.ParamByName[CT_PARAM_DefaultFee].GetAsInteger(1));
     raise Exception.Create('Invalid Fee value');
   end;
   AppParams.ParamByName[CT_PARAM_InternetServerPort].SetAsInteger(udInternetServerPort.Position );
@@ -240,7 +244,7 @@ begin
   if Not Assigned(Value) then exit;
   Try
     udInternetServerPort.Position := AppParams.ParamByName[CT_PARAM_InternetServerPort].GetAsInteger(CT_NetServer_Port);
-    ebDefaultFee.Text := TAccountComp.FormatMoney(AppParams.ParamByName[CT_PARAM_DefaultFee].GetAsInt64(0));
+    ebDefaultFee.Text := TAccountComp.FormatMoney(TSettings.DefaultFee);
     cbJSONRPCMinerServerActive.Checked := AppParams.ParamByName[CT_PARAM_JSONRPCMinerServerActive].GetAsBoolean(true);
     case TMinerPrivateKeyType(AppParams.ParamByName[CT_PARAM_MinerPrivateKeyType].GetAsInteger(Integer(mpk_Random))) of
       mpk_NewEachTime : rbGenerateANewPrivateKeyEachBlock.Checked := true;

+ 1 - 1
src/libraries/abstractmem/ConfigAbstractMem.inc

@@ -24,7 +24,7 @@
 {.$define ABSTRACTMEM_TESTING_MODE}
 // define this if you want some testing mode capabilities
 
-{$define ABSTRACTMEM_ENABLE_STATS}
+{.$define ABSTRACTMEM_ENABLE_STATS}
 // define this to activate some stats on objects usefull for testing
 
 {.$define ABSTRACTMEM_CIRCULAR_SEARCH_PROTECTION}