浏览代码

Improved: save safebox when restoring from file

Will save lasts 2 safeboxs when restoring from file
PascalCoin 6 年之前
父节点
当前提交
8a0cb3c000
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/core/UBlockChain.pas

+ 2 - 1
src/core/UBlockChain.pas

@@ -697,7 +697,8 @@ begin
                 break;
               end else begin
                 // To prevent continuous saving...
-                If (BlocksCount MOD (CT_BankToDiskEveryNBlocks*10))=0 then begin
+                if ((BlocksCount+(CT_BankToDiskEveryNBlocks*2)) >= Storage.LastBlock ) or
+                   ((BlocksCount MOD (CT_BankToDiskEveryNBlocks*10))=0) then begin
                   Storage.SaveBank;
                 end;
                 if (Assigned(restoreProgressNotify)) And (TPlatform.GetElapsedMilliseconds(tc)>1000) then begin