Browse Source

bugs

Bug searching n_operation when in pending buffer
PascalCoin 7 years ago
parent
commit
5f6f63f737
3 changed files with 3 additions and 13 deletions
  1. 1 1
      src/core/UConst.pas
  2. 0 11
      src/core/UNetProtocol.pas
  3. 2 1
      src/core/UNode.pas

+ 1 - 1
src/core/UConst.pas

@@ -150,7 +150,7 @@ Const
   CT_OpSubtype_MultiOperation_Global      = 91;
   CT_OpSubtype_MultiOperation_Global      = 91;
   CT_OpSubtype_MultiOperation_AccountInfo = 92;
   CT_OpSubtype_MultiOperation_AccountInfo = 92;
 
 
-  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'2.1.9'{$ELSE}{$IFDEF TESTNET}'TESTNET 3.0 BETA'{$ELSE}{$ENDIF}{$ENDIF};
+  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'2.1.9'{$ELSE}{$IFDEF TESTNET}'TESTNET 3.1 BETA'{$ELSE}{$ENDIF}{$ENDIF};
 
 
   CT_Discover_IPs =  'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.dynamic-dns.net;pascalcoin2.dynamic-dns.net;pascalcoin1.dns1.us;pascalcoin2.dns1.us;pascalcoin1.dns2.us;pascalcoin2.dns2.us';
   CT_Discover_IPs =  'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.dynamic-dns.net;pascalcoin2.dynamic-dns.net;pascalcoin1.dns1.us;pascalcoin2.dns1.us;pascalcoin1.dns2.us;pascalcoin2.dns2.us';
 
 

+ 0 - 11
src/core/UNetProtocol.pas

@@ -2646,17 +2646,6 @@ begin
 
 
     DoDisconnect := false;
     DoDisconnect := false;
 
 
-    // Build 1.4
-    if b_start<TNode.Node.Bank.Storage.FirstBlock then begin
-      b_start := TNode.Node.Bank.Storage.FirstBlock;
-      if b_end<b_start then begin
-        errors := 'Block:'+inttostr(b_end)+' not found';
-        SendError(ntp_response,HeaderData.operation,HeaderData.request_id,CT_NetError_InternalServerError,errors);
-        exit;
-      end;
-    end;
-
-
     if (b_end>=TNode.Node.Bank.BlocksCount) then b_end := TNode.Node.Bank.BlocksCount-1;
     if (b_end>=TNode.Node.Bank.BlocksCount) then b_end := TNode.Node.Bank.BlocksCount-1;
     inc_b := ((b_end - b_start) DIV CT_Max_Positions)+1;
     inc_b := ((b_end - b_start) DIV CT_Max_Positions)+1;
     msops := TMemoryStream.Create;
     msops := TMemoryStream.Create;

+ 2 - 1
src/core/UNode.pas

@@ -862,7 +862,7 @@ begin
   If (block>=Bank.BlocksCount) then exit; // Invalid block number
   If (block>=Bank.BlocksCount) then exit; // Invalid block number
   If (account>=Bank.AccountsCount) then exit; // Invalid account number
   If (account>=Bank.AccountsCount) then exit; // Invalid account number
   If (n_operation_high<n_operation_low) then exit;
   If (n_operation_high<n_operation_low) then exit;
-  n_operation := Bank.SafeBox.Account(account).n_operation;
+  n_operation := Operations.SafeBoxTransaction.Account(account).n_operation;
   if (n_operation>n_operation_high) then n_operation := n_operation_high;
   if (n_operation>n_operation_high) then n_operation := n_operation_high;
   If (block=0) then begin
   If (block=0) then begin
     // Start searching on pending blocks
     // Start searching on pending blocks
@@ -876,6 +876,7 @@ begin
             opr.Balance:=-1;
             opr.Balance:=-1;
             OpResumeList.Add(opr);
             OpResumeList.Add(opr);
             dec(n_operation);
             dec(n_operation);
+            Result := found;
             Exit;
             Exit;
           end;
           end;
         end;
         end;