Browse Source

Some testnet fixs

PascalCoin 5 years ago
parent
commit
a9abbe54f6
2 changed files with 7 additions and 3 deletions
  1. 6 0
      src/core/UAccounts.pas
  2. 1 3
      src/core/UOpTransaction.pas

+ 6 - 0
src/core/UAccounts.pas

@@ -1627,7 +1627,13 @@ begin
   end else begin
     // V5 only will allow PRIVATE SALES or SWAPS while locked
     if (IsAccountForPublicSale(AAccount.accountInfo)) Then Exit; // Public sales not allowed
+    {$IFDEF TESTNET}
+    // TESTNET ONLY to allow a previous created blockchain
+    if (ACurrentBlock > 7000) and
+      (Not (IsAccountLocked(AAccount.accountInfo,ACurrentBlock))) then Exit; // Time lock expired
+    {$ELSE}
     if (Not (IsAccountLocked(AAccount.accountInfo,ACurrentBlock))) then Exit; // Time lock expired
+    {$ENDIF}
   end;
 
   if (AAccount.accountInfo.state in [as_ForSale, as_ForAtomicAccountSwap]) then begin

+ 1 - 3
src/core/UOpTransaction.pas

@@ -981,10 +981,8 @@ begin
     {$endregion}
     FPrevious_Seller_updated_block := LSeller.updated_on_block;
   end else if // (is auto buy) OR (is transaction that can buy)
-              (FData.opTransactionStyle = transaction_with_auto_buy_account) OR
-              (FData.opTransactionStyle = transaction_with_auto_atomic_swap) OR
               (
-                (FData.opTransactionStyle = transaction) AND
+                (FData.opTransactionStyle in [transaction,transaction_with_auto_buy_account,transaction_with_auto_atomic_swap]) AND
                 (LCurrentProtocol >= CT_PROTOCOL_2) AND
                 (TAccountComp.IsAccountForSaleOrSwapAcceptingTransactions(LTarget, LCurrentBlock, LCurrentProtocol, FData.payload.payload_raw)) AND
                 ((LTarget.balance + FData.amount >= LTarget.accountInfo.price))