Browse Source

core updates and minor bugs fixed

PascalCoin 5 years ago
parent
commit
a420dff132
3 changed files with 10 additions and 3 deletions
  1. 1 1
      src/core/UBlockChain.pas
  2. 5 1
      src/core/UNode.pas
  3. 4 1
      src/core/UPCOperationsSignatureValidator.pas

+ 1 - 1
src/core/UBlockChain.pas

@@ -1132,7 +1132,7 @@ begin
   end;
   LOrd := TOrderedCardinalList.Create;
   try
-    LStart := Integer(AFromBlock) - Integer(ABackBlocks);
+    LStart := Integer(AFromBlock) - Integer(ABackBlocks) + 1;
     LEnd := Integer(AFromBlock);
     if LStart<1 then LStart := 1; // Ensure we will get access to 0 as a previous Timestamp
     LPreviousTimestamp := SafeBox.GetBlockInfo(LStart - 1).timestamp; // Get first previous timestamp

+ 5 - 1
src/core/UNode.pas

@@ -873,7 +873,11 @@ end;
 
 class function TNode.NodeVersion: String;
 begin
-  Result := CT_ClientAppVersion{$IFDEF LINUX}+'L'{$ELSE}+'W'{$ENDIF}{$IFDEF FPC}{$IFDEF LCL}+'l'{$ELSE}+'f'{$ENDIF}{$ENDIF}{$IFDEF FPC}{$IFDEF CPU32}+'32b'{$ELSE}+'64b'{$ENDIF}{$ELSE}{$IFDEF CPU32BITS}+'32b'{$ELSE}+'64b'{$ENDIF}{$ENDIF};
+  Result := CT_ClientAppVersion
+    {$IFDEF LINUX}+'L'{$ELSE}+'W'{$ENDIF}
+    {$IFDEF FPC}{$IFDEF LCL}+'l'{$ELSE}+'f'{$ENDIF}{$ENDIF}
+    {$IFDEF FPC}{$IFDEF CPU32}+'32b'{$ELSE}+'64b'{$ENDIF}{$ELSE}{$IFDEF CPU32BITS}+'32b'{$ELSE}+'64b'{$ENDIF}{$ENDIF}
+    {$IFDEF Use_CryptoLib4Pascal}+'CL4P'{$ENDIF};
 end;
 
 procedure TNode.Notification(AComponent: TComponent; Operation: TOperation);

+ 4 - 1
src/core/UPCOperationsSignatureValidator.pas

@@ -329,7 +329,10 @@ begin
         try
           LIsValid := LOperation.IsValidSignatureBasedOnCurrentSafeboxState(FValidator.FSafeBoxTransaction);
         except
-          LIsValid := False;
+          On E:Exception do begin
+            LIsValid := False;
+            TLog.NewLog(lterror,ClassName,LOperation.ToString+' ERROR: ('+E.ClassName+') '+E.Message);
+          end;
         end;
         FValidator.SetOperationCheckResult(Self,LOperation, LIsValid);
       end;