Bläddra i källkod

Minor updated to 5.7.2

PascalCoin 1 år sedan
förälder
incheckning
d5b09a6b74

+ 8 - 0
src/core/UAbstractMemBlockchainStorage.pas

@@ -216,6 +216,7 @@ type
     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 @@ begin
       LCacheMem.MaxCacheDataBlocks := 750000;
       {$ENDIF};
       LCacheMem.OnFlushedCache := OnCacheMemFlushedCache;
+      LCacheMem.OnLog := OnCacheMemLog;
     finally
       FFileMem.UnlockCache;
     end;
@@ -1376,6 +1378,12 @@ begin
   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);

+ 9 - 0
src/core/UBlockChain.pas

@@ -607,6 +607,7 @@ uses
   UTime, UConst, UOpTransaction, UPCOrderedLists,
   UPCOperationsSignatureValidator,
   UPCOperationsBlockValidator,
+  UAbstractMemBlockchainStorage,
   UNode;
 
 { TPCOperationsStorage }
@@ -1096,6 +1097,7 @@ var fs: TFileStream;
     LBankfilename,Laux_newfilename: AnsiString;
     ms : TMemoryStream;
   LTC : TTickCount;
+  LOldB : Boolean;
 begin
   Result := true;
   LBankfilename := GetSafeboxCheckpointingFileName(GetStorageFolder(Orphan),BlocksCount);
@@ -1140,6 +1142,13 @@ begin
         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;
 
 

+ 1 - 1
src/core/UConst.pas

@@ -199,7 +199,7 @@ Const
   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};

+ 7 - 0
src/core/UPCAbstractMem.pas

@@ -140,6 +140,7 @@ type
     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 @@ begin
     LCacheMem := TFileMem(FAbstractMem).LockCache;
     Try
       LCacheMem.OnFlushedCache := OnCacheMemFlushedCache;
+      LCacheMem.OnLog := OnCacheMemLog;
     Finally
       TFileMem(FAbstractMem).UnlockCache;
     End;
@@ -907,6 +909,11 @@ begin
   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;