Browse Source

Update UAccounts.pas

Optimize validation speed using FSafeboxHash cache value
PascalCoin 5 years ago
parent
commit
c932a56b06
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/core/UAccounts.pas

+ 1 - 2
src/core/UAccounts.pas

@@ -3976,8 +3976,7 @@ begin
   end;
   // initial_safe_box_hash: Only can be checked when adding new blocks, not when restoring a safebox
   If checkSafeBoxHash then begin
-    // TODO: Can use FSafeBoxHash instead of CalcSafeBoxHash ???? Quick speed if possible
-    if (Not TBaseType.Equals(newOperationBlock.initial_safe_box_hash,CalcSafeBoxHash)) then begin
+    if (Not TBaseType.Equals(newOperationBlock.initial_safe_box_hash,FSafeBoxHash)) then begin
       errors := 'BlockChain Safe box hash invalid: '+TCrypto.ToHexaString(newOperationBlock.initial_safe_box_hash)+' var: '+
         TCrypto.ToHexaString(FSafeBoxHash)+
         ' Calculated:'+TCrypto.ToHexaString(CalcSafeBoxHash);