Browse Source

fixed: "price" RPC inconsistency bug

PascalCoin 6 years ago
parent
commit
cad61abd38
2 changed files with 3 additions and 1 deletions
  1. 2 0
      README.md
  2. 1 1
      src/core/URPC.pas

+ 2 - 0
README.md

@@ -65,6 +65,8 @@ TODO: Bug in Lazarus optimization cause Access Violation on "getpendings" call (
     - "protocol" (Integer): Must provide protocol version. By default will use build protocol constant CT_BUILD_PROTOCOL
   - New param for "signbuyaccount"
     - "protocol" (Integer): Must provide protocol version. By default will use build protocol constant CT_BUILD_PROTOCOL
+  - Account Object change:
+    - Changed return value of "price". Previously was returned without decimals in native value (inconsistency bug), now will be returned as a PASCURRENCY (with 4 decimals)
 - Bug fixed: DoProcess_GetAccount_Request request type=1 (single account) didn't returned only 1
 
 

+ 1 - 1
src/core/URPC.pas

@@ -279,7 +279,7 @@ Begin
     as_ForSale : begin
       jsonObj.GetAsVariant('state').Value:='listed';
       jsonObj.GetAsVariant('locked_until_block').Value:=account.accountInfo.locked_until_block;
-      jsonObj.GetAsVariant('price').Value:=account.accountInfo.price;
+      jsonObj.GetAsVariant('price').Value:=ToJSONCurrency(account.accountInfo.price);
       jsonObj.GetAsVariant('seller_account').Value:=account.accountInfo.account_to_pay;
       jsonObj.GetAsVariant('private_sale').Value:= (account.accountInfo.new_publicKey.EC_OpenSSL_NID<>0);
       if not (account.accountInfo.new_publicKey.EC_OpenSSL_NID<>0) then begin