Browse Source

Fix GUI based on latest core

PascalCoin 5 years ago
parent
commit
eb8c6e5d92

+ 1 - 1
src/gui-classic/UFRMOperationsExplorer.pas

@@ -547,7 +547,7 @@ begin
   Try
   Try
     ms.Write(raw[1],Length(raw));
     ms.Write(raw[1],Length(raw));
     ms.Position:=0;
     ms.Position:=0;
-    If Not opht.LoadOperationsHashTreeFromStream(ms,false,0,Nil,errors) then Raise Exception.Create(errors);
+    If Not opht.LoadOperationsHashTreeFromStream(ms,false,TNode.Node.Bank.SafeBox.CurrentProtocol,TNode.Node.Bank.SafeBox.CurrentProtocol,Nil,errors) then Raise Exception.Create(errors);
     For i:=0 to opht.OperationsCount-1 do begin
     For i:=0 to opht.OperationsCount-1 do begin
       FOperationsHashTree.AddOperationToHashTree(opht.GetOperation(i));
       FOperationsHashTree.AddOperationToHashTree(opht.GetOperation(i));
     end;
     end;

+ 6 - 4
src/gui-classic/UFRMRandomOperations.pas

@@ -143,6 +143,7 @@ Var nCounter, nTotalRound, iLastSend, i : Integer;
   errors : String;
   errors : String;
   nAddedOperations, nMaxTransactionsValue, nExecutedSinceLastTC : Integer;
   nAddedOperations, nMaxTransactionsValue, nExecutedSinceLastTC : Integer;
   LLastTC : TTickCount;
   LLastTC : TTickCount;
+  LProtocol : Word;
 begin
 begin
   operationsComp := TPCOperationsComp.Create(Nil);
   operationsComp := TPCOperationsComp.Create(Nil);
   try
   try
@@ -165,22 +166,23 @@ begin
       end;
       end;
       while (nCounter<nTotalRound) And (Not Terminated) And (FAllowExecute) do begin
       while (nCounter<nTotalRound) And (Not Terminated) And (FAllowExecute) do begin
         inc(nCounter);
         inc(nCounter);
+        LProtocol := operationsComp.OperationBlock.protocol_version;
         //
         //
         Case Random(30) of
         Case Random(30) of
           0..10 : begin
           0..10 : begin
             if FMaxOperationsPerSecond>0 then nMaxTransactionsValue := Random(FMaxOperationsPerSecond)+1
             if FMaxOperationsPerSecond>0 then nMaxTransactionsValue := Random(FMaxOperationsPerSecond)+1
             else nMaxTransactionsValue := Random(200)+1;
             else nMaxTransactionsValue := Random(200)+1;
 
 
-            inc(FnOperationsCreated,TRandomGenerateOperation.GenerateOpTransactions(FSourceNode.Bank.SafeBox.CurrentProtocol,nMaxTransactionsValue,operationsComp,FSourceWalletKeys));
+            inc(FnOperationsCreated,TRandomGenerateOperation.GenerateOpTransactions(LProtocol,nMaxTransactionsValue,operationsComp,FSourceWalletKeys));
           end;
           end;
           11..15 : begin
           11..15 : begin
-            inc(FnOperationsCreated,TRandomGenerateOperation.GenerateOpChangeKey(FSourceNode.Bank.SafeBox.CurrentProtocol,operationsComp,FSourceWalletKeys));
+            inc(FnOperationsCreated,TRandomGenerateOperation.GenerateOpChangeKey(LProtocol,operationsComp,FSourceWalletKeys));
           end;
           end;
           18..22 : begin
           18..22 : begin
-            inc(FnOperationsCreated,TRandomGenerateOperation.GenerateOpListAccountForSale(FSourceNode.Bank.SafeBox.CurrentProtocol,operationsComp,FSourceWalletKeys));
+            inc(FnOperationsCreated,TRandomGenerateOperation.GenerateOpListAccountForSale(LProtocol,operationsComp,FSourceWalletKeys));
           end;
           end;
           25..29 : begin
           25..29 : begin
-            If TRandomGenerateOperation.GenerateOpMultiOperation(FSourceNode.Bank.SafeBox.CurrentProtocol,operationsComp,FSourceWalletKeys) then inc(FnOperationsCreated)
+            If TRandomGenerateOperation.GenerateOpMultiOperation(LProtocol,operationsComp,FSourceWalletKeys) then inc(FnOperationsCreated)
             else inc(FnOperationsCreatedFailed);
             else inc(FnOperationsCreatedFailed);
           end;
           end;
         end;
         end;