Skip to content

Commit

Permalink
Set final changes to 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalCoinDev committed Dec 22, 2021
1 parent a1f84ba commit 6753de8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/core/UBlockChain.pas
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/core/UConst.pas
Expand Up @@ -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;
Expand Down
14 changes: 12 additions & 2 deletions src/gui-classic/UFRMOperation.pas
Expand Up @@ -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}
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions src/gui-classic/UFRMPascalCoinWalletConfig.pas
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/abstractmem/ConfigAbstractMem.inc
Expand Up @@ -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}
Expand Down

0 comments on commit 6753de8

Please sign in to comment.