瀏覽代碼

Update UPCOperationsSignatureValidator.pas

Protection when cannot check valid signature
PascalCoin 6 年之前
父節點
當前提交
fac146ff2f
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/core/UPCOperationsSignatureValidator.pas

+ 7 - 1
src/core/UPCOperationsSignatureValidator.pas

@@ -310,13 +310,19 @@ end;
 
 
 procedure TPCOperationsSignatureValidatorThread.BCExecute;
 procedure TPCOperationsSignatureValidatorThread.BCExecute;
 var LOperation : TPCOperation;
 var LOperation : TPCOperation;
+    LIsValid : Boolean;
 begin
 begin
   repeat
   repeat
     LOperation := FValidator.GetNextOperation(Self);
     LOperation := FValidator.GetNextOperation(Self);
     if Assigned(LOperation) then begin
     if Assigned(LOperation) then begin
       if Not LOperation.HasValidSignature then begin
       if Not LOperation.HasValidSignature then begin
         // Only will validate if HasValidSignature is False (Not validated before)
         // Only will validate if HasValidSignature is False (Not validated before)
-        FValidator.SetOperationCheckResult(Self,LOperation, LOperation.IsValidSignatureBasedOnCurrentSafeboxState(FValidator.FSafeBoxTransaction));
+        try
+          LIsValid := LOperation.IsValidSignatureBasedOnCurrentSafeboxState(FValidator.FSafeBoxTransaction);
+        except
+          LIsValid := False;
+        end;
+        FValidator.SetOperationCheckResult(Self,LOperation, LIsValid);
       end;
       end;
     end;
     end;
   until (Not Assigned(LOperation)) or (Terminated);
   until (Not Assigned(LOperation)) or (Terminated);