Selaa lähdekoodia

Flushing blockchain cache once downloaded blocks

PascalCoin 1 vuosi sitten
vanhempi
commit
c052738b59
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      src/core/UNetProtocol.pas

+ 3 - 0
src/core/UNetProtocol.pas

@@ -3049,6 +3049,9 @@ begin
     TNode.Node.Bank.SafeBox.PCAbstractMem.FlushCache;
     TNode.Node.Bank.SafeBox.PCAbstractMem.FlushCache;
     if (TNode.Node.Bank.Storage is TAbstractMemBlockchainStorage) then begin
     if (TNode.Node.Bank.Storage is TAbstractMemBlockchainStorage) then begin
       TAbstractMemBlockchainStorage( TNode.Node.Bank.Storage ).AutoFlushCache := LPrevious;
       TAbstractMemBlockchainStorage( TNode.Node.Bank.Storage ).AutoFlushCache := LPrevious;
+      if TAbstractMemBlockchainStorage( TNode.Node.Bank.Storage ).PendingToSave = 0 then begin
+        TAbstractMemBlockchainStorage( TNode.Node.Bank.Storage ).FileMem.FlushCache;
+      end;
     end;
     end;
     {$ENDIF}
     {$ENDIF}
   end;
   end;