From 01dfdc6b67a1d2b540c1458deabe2ccabe0b3255 Mon Sep 17 00:00:00 2001 From: dimxy Date: Fri, 19 Apr 2019 22:12:21 +0500 Subject: [PATCH] addfunding now in coins try correct fraction of profits --- src/cc/prices.cpp | 2 +- src/rpc/blockchain.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index b94cb7dfe..026c75181 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -663,7 +663,7 @@ int64_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t //std::cerr << "prices_syntheticprofits() profits double=" << (double)price / (double)costbasis -1.0 << std::endl; //double dprofits = (double)price / (double)costbasis - 1.0; - profits *= leverage * positionsize; + profits *= leverage * positionsize / SATOSHIDEN; //dprofits *= leverage * positionsize; std::cerr << "prices_syntheticprofits() val profits=" << profits << std::endl; //std::cerr << "prices_syntheticprofits() dprofits=" << dprofits << std::endl; diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index fefec1337..1f6fcadcf 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1358,7 +1358,7 @@ UniValue pricesaddfunding(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 2) throw runtime_error("pricesaddfunding bettxid amount\n" - "where amount is in satoshis\n"); + "where amount is in coins\n"); LOCK(cs_main); UniValue ret(UniValue::VOBJ); @@ -1370,7 +1370,7 @@ UniValue pricesaddfunding(const UniValue& params, bool fHelp) if (bettxid.IsNull()) throw runtime_error("invalid bettxid\n"); - CAmount amount = atoll(params[1].get_str().c_str()); + CAmount amount = atof(params[1].get_str().c_str()) * COIN; if (amount <= 0) throw runtime_error("invalid amount\n");