diff --git a/src/core/UAbstractMemBlockchainStorage.pas b/src/core/UAbstractMemBlockchainStorage.pas index 5c28c203..d1221c70 100644 --- a/src/core/UAbstractMemBlockchainStorage.pas +++ b/src/core/UAbstractMemBlockchainStorage.pas @@ -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; @@ -1028,6 +1029,7 @@ function TAbstractMemBlockchainStorage.DoInitialize: Boolean; LCacheMem.MaxCacheDataBlocks := 750000; {$ENDIF}; LCacheMem.OnFlushedCache := OnCacheMemFlushedCache; + LCacheMem.OnLog := OnCacheMemLog; finally FFileMem.UnlockCache; end; @@ -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); diff --git a/src/core/UBlockChain.pas b/src/core/UBlockChain.pas index 0fba843f..2ac3b37f 100644 --- a/src/core/UBlockChain.pas +++ b/src/core/UBlockChain.pas @@ -607,6 +607,7 @@ implementation UTime, UConst, UOpTransaction, UPCOrderedLists, UPCOperationsSignatureValidator, UPCOperationsBlockValidator, + UAbstractMemBlockchainStorage, UNode; { TPCOperationsStorage } @@ -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); @@ -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; diff --git a/src/core/UConst.pas b/src/core/UConst.pas index 44bbe950..ff7d5094 100644 --- a/src/core/UConst.pas +++ b/src/core/UConst.pas @@ -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}; diff --git a/src/core/UPCAbstractMem.pas b/src/core/UPCAbstractMem.pas index 0ad2fa7b..abbfc2b1 100644 --- a/src/core/UPCAbstractMem.pas +++ b/src/core/UPCAbstractMem.pas @@ -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; @@ -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; @@ -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;