Browse Source

Improve V4 speed

Delete recalc pow (due not needed). This improves speed on V4 caused by slow RandomHash algo
PascalCoin 7 years ago
parent
commit
6f08a77761
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/core/UBlockChain.pas

+ 3 - 3
src/core/UBlockChain.pas

@@ -1011,7 +1011,7 @@ begin
     FIsOnlyOperationBlock := false;
     FIsOnlyOperationBlock := false;
   Finally
   Finally
     try
     try
-      CalcProofOfWork(true,FOperationBlock.proof_of_work);
+      Calc_Digest_Parts; // Does not need to recalc PoW
     finally
     finally
       Unlock;
       Unlock;
     end;
     end;
@@ -1058,7 +1058,7 @@ begin
     end;
     end;
     FPreviousUpdatedBlocks.CopyFrom(Operations.FPreviousUpdatedBlocks);
     FPreviousUpdatedBlocks.CopyFrom(Operations.FPreviousUpdatedBlocks);
     // Recalc all
     // Recalc all
-    CalcProofOfWork(true,FOperationBlock.proof_of_work);
+    Calc_Digest_Parts; // Does not need to recalc PoW
   finally
   finally
     Unlock;
     Unlock;
   end;
   end;
@@ -1400,7 +1400,7 @@ begin
       FOperationBlock.operations_hash := FOperationsHashTree.HashTree;
       FOperationBlock.operations_hash := FOperationsHashTree.HashTree;
     End;
     End;
   Finally
   Finally
-    CalcProofOfWork(true,FOperationBlock.proof_of_work);
+    Calc_Digest_Parts; // Does not need to recalc PoW
     Unlock;
     Unlock;
   End;
   End;
   if (n>0) then begin
   if (n>0) then begin