Skip to content

Commit

Permalink
Minor updated to 5.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalCoinDev committed Oct 4, 2023
1 parent 749d7af commit d5b09a6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/core/UAbstractMemBlockchainStorage.pas
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ TPendingData = record
Function DoLoadBlockChainExt(Operations : TPCOperationsComp; Block : Cardinal; const AOrphan : String) : Boolean;
procedure AddMessage(AMessages : TStrings; const AMessage : String; ARaiseAnException : Boolean);
procedure OnCacheMemFlushedCache(const ASender : TCacheMem; const AProcessDesc : String; AElapsedMilis: Int64);
procedure OnCacheMemLog(ASender : TObject; const ALog : String);
protected
procedure SetReadOnly(const Value: Boolean); override;
Function DoGetBlockInformation(const ABlock : Integer; var AOperationBlock : TOperationBlock; var AOperationsCount : Integer; var AVolume : Int64) : Boolean; override;
Expand Down Expand Up @@ -1028,6 +1029,7 @@ function TAbstractMemBlockchainStorage.DoInitialize: Boolean;
LCacheMem.MaxCacheDataBlocks := 750000;
{$ENDIF};
LCacheMem.OnFlushedCache := OnCacheMemFlushedCache;
LCacheMem.OnLog := OnCacheMemLog;
finally
FFileMem.UnlockCache;
end;
Expand Down Expand Up @@ -1376,6 +1378,12 @@ procedure TAbstractMemBlockchainStorage.OnCacheMemFlushedCache(
TLog.NewLog(ltdebug,ASender.ClassName,Self.ClassName+' '+AProcessDesc)
end;

procedure TAbstractMemBlockchainStorage.OnCacheMemLog(ASender: TObject;
const ALog: String);
begin
TLog.NewLog(ltdebug,ASender.ClassName,Self.ClassName+' '+ALog);
end;

class function TAbstractMemBlockchainStorage.OrphanCompare(const ALeft, ARight: String): Integer;
begin
Result := BinStrComp(ALeft,ARight);
Expand Down
9 changes: 9 additions & 0 deletions src/core/UBlockChain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ implementation
UTime, UConst, UOpTransaction, UPCOrderedLists,
UPCOperationsSignatureValidator,
UPCOperationsBlockValidator,
UAbstractMemBlockchainStorage,
UNode;

{ TPCOperationsStorage }
Expand Down Expand Up @@ -1096,6 +1097,7 @@ function TPCBank.DoSaveBank: Boolean;
LBankfilename,Laux_newfilename: AnsiString;
ms : TMemoryStream;
LTC : TTickCount;
LOldB : Boolean;
begin
Result := true;
LBankfilename := GetSafeboxCheckpointingFileName(GetStorageFolder(Orphan),BlocksCount);
Expand Down Expand Up @@ -1140,6 +1142,13 @@ function TPCBank.DoSaveBank: Boolean;
end;
end;
end;
// Flush pending
if (FStorage is TAbstractMemBlockchainStorage) then begin
LOldB := TAbstractMemBlockchainStorage(FStorage).UseMultithread;
TAbstractMemBlockchainStorage(FStorage).UseMultithread := False;
TAbstractMemBlockchainStorage(FStorage).UseMultithread := LOldB;

end;
end;


Expand Down
2 changes: 1 addition & 1 deletion src/core/UConst.pas
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ interface
CT_OpSubtype_Data_Signer = 103;
CT_OpSubtype_Data_Receiver = 104;

CT_ClientAppVersion : String = {$IFDEF PRODUCTION}'5.7.1'{$ELSE}{$IFDEF TESTNET}'TESTNET 5.7.1'{$ELSE}{$ENDIF}{$ENDIF};
CT_ClientAppVersion : String = {$IFDEF PRODUCTION}'5.7.2'{$ELSE}{$IFDEF TESTNET}'TESTNET 5.7.2'{$ELSE}{$ENDIF}{$ENDIF};

CT_Discover_IPs = {$IFDEF PRODUCTION}'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.dynamic-dns.net;pascalcoin2.dynamic-dns.net;pascalcoin1.dns1.us;pascalcoin2.dns1.us;pascalcoin1.dns2.us;pascalcoin2.dns2.us'
{$ELSE}'pascaltestnet1.dynamic-dns.net;pascaltestnet2.dynamic-dns.net;pascaltestnet1.dns1.us;pascaltestnet2.dns1.us'{$ENDIF};
Expand Down
7 changes: 7 additions & 0 deletions src/core/UPCAbstractMem.pas
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ TPCAbstractMem = class
procedure SetMaxAccountKeysCache(const Value: Integer);
procedure SetSavingNewSafeboxMode(const Value: Boolean);
procedure OnCacheMemFlushedCache(const ASender : TCacheMem; const AProcessDesc : String; AElapsedMilis: Int64);
procedure OnCacheMemLog(ASender : TObject; const ALog : String);
protected
procedure UpgradeAbstractMemVersion(const ACurrentHeaderVersion : Integer);
function DoGetAccount(AAccountNumber : Integer; var AAccount : TAccount) : Boolean;
Expand Down Expand Up @@ -522,6 +523,7 @@ constructor TPCAbstractMem.Create(const ASafeboxFileName: string; AReadOnly: boo
LCacheMem := TFileMem(FAbstractMem).LockCache;
Try
LCacheMem.OnFlushedCache := OnCacheMemFlushedCache;
LCacheMem.OnLog := OnCacheMemLog;
Finally
TFileMem(FAbstractMem).UnlockCache;
End;
Expand Down Expand Up @@ -907,6 +909,11 @@ procedure TPCAbstractMem.OnCacheMemFlushedCache(const ASender: TCacheMem;
TLog.NewLog(ltdebug,ASender.ClassName,Self.ClassName+' '+AProcessDesc)
end;

procedure TPCAbstractMem.OnCacheMemLog(ASender: TObject; const ALog: String);
begin
TLog.NewLog(ltdebug,ASender.ClassName,Self.ClassName+' '+ALog);
end;

function TPCAbstractMem.AccountsCount: integer;
begin
Result := FAccounts.Count;
Expand Down

0 comments on commit d5b09a6

Please sign in to comment.