diff --git a/CHANGELOG.md b/CHANGELOG.md index bb7e44848..f99b3f671 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/src/core/UBlockChain.pas b/src/core/UBlockChain.pas index 91d1b4c74..678f4dbb5 100644 --- a/src/core/UBlockChain.pas +++ b/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.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 @@ function TStorage.DoGetAccountOperations(AAccount, AMaxDepth, AStartOperation, 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; diff --git a/src/core/UConst.pas b/src/core/UConst.pas index 85ed227e5..b6aac90aa 100644 --- a/src/core/UConst.pas +++ b/src/core/UConst.pas @@ -132,10 +132,10 @@ interface 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; diff --git a/src/gui-classic/UFRMOperation.pas b/src/gui-classic/UFRMOperation.pas index 21bf29531..a829f6af7 100644 --- a/src/gui-classic/UFRMOperation.pas +++ b/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 @@ function TFRMOperation.UpdateFee(var Fee: Int64; errors: String): Boolean; 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); diff --git a/src/gui-classic/UFRMPascalCoinWalletConfig.pas b/src/gui-classic/UFRMPascalCoinWalletConfig.pas index 80f40a195..afc8061ff 100644 --- a/src/gui-classic/UFRMPascalCoinWalletConfig.pas +++ b/src/gui-classic/UFRMPascalCoinWalletConfig.pas @@ -115,9 +115,13 @@ procedure TFRMPascalCoinWalletConfig.bbOkClick(Sender: TObject); 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 @@ procedure TFRMPascalCoinWalletConfig.SetAppParams(const Value: TAppParams); 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; diff --git a/src/libraries/abstractmem/ConfigAbstractMem.inc b/src/libraries/abstractmem/ConfigAbstractMem.inc index d76b60740..08dd696e4 100644 --- a/src/libraries/abstractmem/ConfigAbstractMem.inc +++ b/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}