Browse Source

Add some logs on UNetProtocol

Add some logs when operation not found at FastPropagation
PascalCoin 5 years ago
parent
commit
1565930089
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/core/UNetProtocol.pas

+ 6 - 2
src/core/UNetProtocol.pas

@@ -3793,10 +3793,14 @@ var operationsComp : TPCOperationsComp;
     for i := 0 to High(nfpboarr) do begin
     for i := 0 to High(nfpboarr) do begin
       auxOp := TPCOperation.GetOperationFromStreamData( (nfpboarr[i].opStreamDataUsingV5EncodeStyle), original_OperationBlock.protocol_version , nfpboarr[i].opStreamData );
       auxOp := TPCOperation.GetOperationFromStreamData( (nfpboarr[i].opStreamDataUsingV5EncodeStyle), original_OperationBlock.protocol_version , nfpboarr[i].opStreamData );
       if not Assigned(auxOp) then begin
       if not Assigned(auxOp) then begin
-        errors := Format('Op index not available (%d/%d) OpReference:%d size:%d',[i,High(nfpboarr),nfpboarr[i].opReference,Length(nfpboarr[i].opStreamData)]);
+        errors := Format('ERR 20191126-1 Op index not available (%d/%d) OpReference:%s size:%d',[i,High(nfpboarr),IntToHex(nfpboarr[i].opReference,8),Length(nfpboarr[i].opStreamData)]);
+        TLog.NewLog(lterror,ClassName,errors);
         Exit;
         Exit;
       end else begin
       end else begin
-        if Not operationsComp.AddOperation(False,auxOp,errors) then Exit;
+        if Not operationsComp.AddOperation(False,auxOp,errors) then begin
+          TLog.NewLog(lterror,ClassName,Format('ERR 20191126-2 Invalid operation %d/%d Err:%s Operation:%s',[i,High(nfpboarr),errors,auxOp.ToString]));
+          Exit;
+        end;
         auxOp.Free;
         auxOp.Free;
       end;
       end;
     end;
     end;